Questions tagged [logs]

Configuring or analysing log files (text files where programs output error and informational messages, useful for debugging and troubleshooting).

Filter by
Sorted by
Tagged with
1
vote
1answer
370 views

python script output won't be directed to file

I have a python script. It has a SimpleLogger with sys.stdout as output_stream. logger = SimpleLogger(level=LogLevel.DEBUG) When I run it in console, I get the logs properly, but whenever I ...
0
votes
1answer
25 views

how to send lines/messages to maillog file [closed]

under /var/log , we can see the following maillog files -rw------- 1 root root 11733421 Aug 5 03:47 maillog-20180805 -rw------- 1 root root 15566137 Aug 13 03:16 maillog-...
4
votes
1answer
52 views

Where should I put ownerless log file

I have a script that moves in and out of using sudo. Certain commands have to be executed as $USER and certain commands have to be executed as root. Currently, I'm running a loop in the background ...
1
vote
0answers
95 views

Remove new line in Postgresql log before sent to Graylog

i want to remove all new line in Postgresql log before sent them to Graylog. Example, 2018-08-30 00:00:00 WIB [29212] hi_user@myDatabase 172.21.253.44 LOG: duration: 1044.000 ms execute 32: ...
0
votes
1answer
229 views

atop + what define when /var/log/atop/atop_log should be created

today I installed the atop tool ( before two hours ) in order to trace the OS performance rpm -i atop-2.3.0-8.el7.x86_64.rpm atop -V Version: 2.3.0 - 2017/03/25 09:59:59 <gerlof.langeveld@...
-1
votes
1answer
48 views

Error Displaying last 10 minutes log with awk [duplicate]

I am using below command to display log data for last 10 mins. It works fine if the month stays same however when month is changed it doesn't show any data. awk -v d1="$D1" -v d2="$D2" '$0 > d1 &...
0
votes
1answer
33 views

Lubuntu: reboot-log-entries don´t seem to be correct

I´ve recently taken a look at my reboot-logs with last -x | grep reboot : reboot system boot 4.4.0-134-generi Tue Aug 28 12:20 still running reboot system boot 4.4.0-134-generi Mon Aug 27 14:...
0
votes
1answer
457 views

Bash script to monitor log, match keyword then send commands [duplicate]

#!/bin/bash sudo tail -fn0 /home/main/time.log | grep -o --line-buffered 'garage\|garden\|porch' | head -1 | while read line; do sudo pkill -f porch.sh & sudo pkill -f garage.sh & done I'...
1
vote
3answers
240 views

Display lines in last 10 minutes with specific pattern in logs

I need to display lines with Error occurred in last 10 minutes of a log file. Aug 26 10:50:42 Normal line. Aug 26 10:51:23 Normal line. Aug 26 10:55:33 Error line. Aug 26 10:56:45 Normal line. Aug ...
0
votes
0answers
24 views

Get readable terminal log during python program execution [duplicate]

I'm trying to redirect the output of a python program using script command from a gnome-terminal. $script ~/Documents/log.txt $python test.py But the saved file log.txt is unreadable. It's like: ...
0
votes
1answer
78 views

bash script output not written to file in folder

My goal is to run a script in crontab and save its output (via echo commands) to a log file. Thus, I am using the following: $HOME/folder/sh/script.sh 1>$HOME/folder/logs/script.log 2>$HOME/...
0
votes
0answers
23 views

Redirect output to a file creating old.gz after some time

I am redirecting my Java process output to log file as below nohup java myRunnable.jar &> /varlog/runnableJar.log & Program working file, but after some time we can see that new file ...
0
votes
0answers
16 views

Logrotate File Numbering [UBUNTU 14.04]

root@osshonisyslog1s:/var/log/upstart# ls -Anh | grep graylog-server && vim /etc/logrotate.d/upstart -rw-r----- 1 0 0 3.0G Aug 21 11:32 graylog-server.log -rw-r----- 1 0 0 1.1G Aug 21 11:26 ...
0
votes
1answer
35 views

Logrotate Timing?

I've configured logrotation and it works the way I want it to when I force the update. I'm using the filesize condition as you can see in the config below, but I'm wondering how often this condition ...
0
votes
1answer
128 views

Upstart Logrotate?

What's wrong with my config? I had to --force the logrotate a couple times to see changes, but the numbering is all wonky. ----@----------:/var/log/upstart# ls -Anh total 4.0G -rw-r----- ...
1
vote
1answer
171 views

rsyslog only making log files in /var/logs

Running centos 7, my rsyslog.conf looks like this: 59 # Log all the mail messages in one place. 60 mail.* /var/log/maillog 61 mail.* /var/log/logtest1 62 mail.* /root/logtest Then I use the ...
0
votes
1answer
602 views

Bash Script: To log MQTT feed to txt file

I have written a small bash script (datalogger.sh) to store the mqtt data on to SD card inside a linux machine. The bash script is as below:- #!/bin/bash fileNumber=1 temp=1 // flag to check and ...
0
votes
2answers
34 views

Segregate Data in Log files

I want to segregate error types in my log file. I am unable to make a logic for it. Suppose i have these different types of errors in a log file. Now i want to extract those types only. Like in below ...
1
vote
1answer
301 views

iperf3 results should look nice in a logfile

I have this result: Wed Aug 15 19:35:11 CEST 2018 Connecting to host x.x.x.x, port 5201 [ 4] local x.x.x.x port 48944 connected to x.x.x.x port 5201 [ ID] Interval Transfer Bandwidth ...
0
votes
1answer
68 views

Is there a way to get the file operations of an apt or dpkg transaction?

For security system maintenance reasons I would very much like to know the filename of each and every file modified by an apt transaction. Think: ?\> apt install foobar --trans-log-file=foobar....
1
vote
0answers
44 views

Where do Logrotate files end up?

I've got a Graylog server that I configured logrotating on. /var/lib/graylog-server/journal/messagejournal-0/000*.log { size 2G create 550 ubuntu ubuntu rotate 5 } I came in one morning ...
1
vote
1answer
57 views

IP Logging with Ubuntu Server

I use Ubuntu to host my web sites. I would like to generate a log of every IP address that "touches" my Ubuntu installation - including ping, port scans, etc, not just http requests. What would be an ...
19
votes
3answers
5k views

How do I find the line number in Bash when an error occured?

How do you find the line number in Bash where an error occurred? Example I create the following simple script with line numbers to explain what we need. The script will copy files from cp $file1 $...
10
votes
3answers
387 views

Linux system time temporally jumps

I saw a strange system time changing behavior in some (hardware) servers: in /var/logs/syslog, the date time preceding each log message sometimes change to a random one and gets back to normal in the ...
1
vote
1answer
1k views

Does this line in a log mean that I have a bad RAM sector or chip?

Aug 4 15:11:09 LiquidNZXT kernel: [ 0.000000] *BAD*gran_size: 64K chunk_size: 32M num_reg: 10 lose cover RAM: -16M Does this line in a log mean I have a bad RAM sector or chip?
0
votes
2answers
106 views

awk + append lines before captured word only if lines are not defined in the file

The following awk syntax will add the 3 lines in the file before the line with the word - 'DatePattern': $ awk 'done != 1 && /DatePattern/ { print "log4j.appender.DRFA=org.apache.log4j....
3
votes
5answers
916 views

Insert multiline text before the first matching line in a file

we want to add the following lines in log4j file log4j.appender.DRFA=org.apache.log4j.RollingFileAppender log4j.appender.DRFA.MaxBackupIndex=100 log4j.appender.DRFA.MaxFileSize=10MB but these lines ...
-1
votes
2answers
74 views

sed + mark line in case of marched word

we want to mark with "#" the matched line by sed or perl line liner for example we want to mark all lines in file that include the DatePattern word log4j.appender.DRFA.DatePattern=.yyyy-MM-dd ...
0
votes
1answer
34 views

How to real-time display a number from a running log file or terminal [closed]

I have a CNC and the software runs from a terminal. I would like to catch the current Z axis depth in real-time to display it. The information I need is shown in the terminal as well as in the log ...
3
votes
1answer
424 views

Which Apache2 add-on are these logs from?

I remember using a logging module or add-on for apache2 to inspect the contents of POST/PUT/GET data coming in and out of my webserver. Here's a screenshot that I took back then:
0
votes
1answer
663 views

Linux logrotate, how to configure logrotate to remove all logs older than one month?

We have Linux Red Hat servers - version 7.2. We have the following Hive logs under /var/log/hive. How can we configure the Linux logrotate so every log file that's older than one month will be ...
1
vote
1answer
102 views

logdata to InfluxDB

I have this script that takes download speed and puts data into a logfile. $ wget -O /dev/null ftp://someftpsite:password@ftp.test.com/testdump300 2>&1 | \ awk '/[0-9]+ [M]B\/s/{ sub("\\(","...
2
votes
1answer
2k views

Username is not in the sudoers file. This incident will be reported - WHERE/HOW? [duplicate]

When a user not in sudoers tries to elevate privileges to root (in Ubuntu 18.04 for example) the OS displays this alert: "Username is not in the sudoers file. This incident will be reported". Now, ...
1
vote
0answers
83 views

Daily Log Files from Single Log File [duplicate]

I want to split my user.log file which is always in open mode as logs are written every time. I want to split it into daily log files i.e. userlogs_29072018 and the main user.log file should have data ...
3
votes
1answer
457 views

Use Variable Date in Sed Command

I want to use sed command as below: $ sed -n '/MONTH_TODAY DATE_YEST/,/MONTH_TODAY DATE_TODAY/p' \ /home/crmiib/TESTUSERLOG/XYZ/user.log I can print logs using: $ sed -n '/Jul 27/,/Jul 28/p' /...
2
votes
2answers
325 views

Select a portion of text from `wget` output and log to a file?

I have this small script to test a FTP site: #!/bin/bash wget -O /dev/null ftp://someftpsite:password@ftp.test.com/testdump300 2>&1 | \ grep '\([0-9.]\+ [M]B/s\)' >> wget300.log And ...
1
vote
1answer
288 views

What is the Windows equivalent of 'Audit log cleared' event in Unix/Linux?

Windows has EventID 1102 "The audit log was cleared". What is the equivalent audit event in Unix/Linux? If someone has a sample event, and know what audit policy needs to be configured to get this ...
0
votes
0answers
59 views

Logrotate ignoring log file without suffix?

My problem is simple. I have 5 log files in a folder, like this: software1.txt, software2.txt, etc. My Logrotate script, as follows, runs daily: /var/ftp/logs/*.txt { daily rotate 36500 ...
1
vote
1answer
74 views

List that contains the last installed / upgraded packages in Arch Linux but with skip dependences

How can I get a list of packages, that were last installed or upgraded by pacman/ pacaur in Arch Linux including the timestamp? I have one more condition as well, I want to skip dependences. I only ...
1
vote
1answer
716 views

IPtables logging is not working in CentOS 7

I want to log all the traffic which comes in and out from the port X. I have followed below steps. Edited /etc/syslog.conf , /etc/rsyslog.conf , /etc/systemd/system/rsyslog.service.d/rsyslog.conf ...
1
vote
1answer
144 views

`sudo` session logging in binary?

I recently started working on sudo and i am trying to explore and understand the different aspects of sudo logging - I/O and audit. I'm using sudo 1.8.22 package on Red hat linux 6.7. Does sudo write ...
1
vote
1answer
1k views

SUDO I/O logs and TSID

I trying to understand the details of sudo session logs, specifically about TSID. I have a few questions: What does TSID stand for? It is a 6 character sequence which forms the directory structure - ...
0
votes
0answers
30 views

How can I save a command output to a file in real-time? [duplicate]

How can I save a command output to a file in real-time? For example, if my command is python log.py where log.py contains: import time print('testing') time.sleep(100) # sleeping for 100 seconds ...
5
votes
1answer
276 views

Track size of a directory over time

I have a directory and I want to log, from now on, its size every day. That is, at some time of day, every day, I want to compute the size of this directory, and append it in some file along with the ...
0
votes
0answers
43 views

React to a writing error

Hi there, I'm curently working on a debian system, this system (under Jessie) write datas to an SDcard really often, sometimes (i'm working on it but it is not the question here) the system is unable ...
0
votes
1answer
193 views

Syslog-ng loggen

Here's the situation: I have syslog-ng version 3.15. I've noticed that when using TLS and non-TLS transmission, the logs are different. I have noticed that, when sending logs using the loggen -i (...
4
votes
4answers
5k views

read first line from .gz compressed file without decompressing entire file

I have a huge log file compressed in .gz format and I want to just read the first line of it without uncompressing it to just check the date of the oldest log in the file. The logs are of the form: ...
1
vote
1answer
91 views

Is it possible to monitor all write access to the filesystem of all process [closed]

Is it possible to monitor all write access to the filesystem of all process under linux? I've some different mounted filesystems. A lot of them are tempfs. I'm interested in all writes to the root ...
2
votes
1answer
70 views

Why are my visits logged under differing IPs?

I have seven websites hosted with the same provider, all part of the same hosting plan. Yesterday I visited all my sites one after another and looked at the Apache access logs. At that time, several ...
0
votes
0answers
213 views

Debian: Disable logging SSH sessions for an user

I have a cron job running that gets a file from a server once a minute with a specific user (UID 999). Since the scp command runs every minute, it quite floods my auth log. Is there a way to disable ...