Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange
Join us in building a kind, collaborative learning community via our updated Code of Conduct.

Questions tagged [logs]

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

0
votes
0answers
19 views

rsyslog not writing logs [on hold]

rsyslog on CentOS 7 doesn't seem to make the log file I need, but ONLY if I want the log file outside /var/log/. Is this intentional? If so, how can I circumvent this?
0
votes
1answer
28 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
25 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
32 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 ...
14
votes
3answers
1k 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 $...
0
votes
0answers
12 views

Bash - how to create a rotate log script [duplicate]

I’m a beginner in writing bash scripts. Need help on how to create a bash script that rotate logs. Here’s what I’m trying to do: - create a log directory. The directory is an argument to routate the ...
5
votes
0answers
40 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
votes
1answer
45 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
61 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
387 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
31 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
18 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
376 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:
1
vote
1answer
43 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 ...
0
votes
1answer
14 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("\\(","...
1
vote
1answer
43 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
21 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
66 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' /...
0
votes
0answers
40 views

Split Logs into different files - BASH/LINUX [duplicate]

I want to do the following for my official assignment. I have a user.log file with mammoth amount of logs, I need to cut down that file into small files. Requirements are as follows: Main User.log ...
2
votes
2answers
20 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
37 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
28 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
40 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
53 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
17 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
37 views

SUDO I/O logs and TSID

I am new to sudo and 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 ...
0
votes
0answers
18 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 ...
4
votes
1answer
235 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
6 views

OSSEC-agent include GPS geolocation with alerts

I am trying to add geolocation to my log alerts based on actual GPS data, NOT IP address. Let's say my current location is stored in /var/local/gps file. Would it be possible to read that file and ...
0
votes
0answers
24 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
44 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 (...
0
votes
4answers
123 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: ...
0
votes
0answers
3 views

Install Ossec Agent on build time

I am trying to compile ossec-agent on build time of a Linux system but I am having all sort of issues(permission, queue file is missing, etc). Is anyone of you guys familiar with this topic? Thanks
0
votes
0answers
48 views

Why samba logs with user “nobody” always appears?

I always have this logs in my /var/log/auth.log, for every 10-20 seconds. Jun 22 11:31:12 debian smbd[1795]: pam_unix(samba:session): session closed for user nobody Jun 22 11:31:08 debian smbd[1794]: ...
1
vote
1answer
47 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
65 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
51 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 ...
0
votes
0answers
19 views

Hostname in the audit reports not shown

I'm creating a nfs share. Also i configured auditd to combine the logs to a centralized server. I configured audisp-remote as per the instructions in the link: https://luppeng.wordpress.com/2016/08/...
3
votes
1answer
91 views

How to decode audit logs

I'm auditing the files in a nfs share. When I look at the audit logs using the command ausearch -f /var/nfs/general , I get some logs that looks like this: time->Tue Jun 12 16:23:34 2018 type=...
1
vote
0answers
32 views

Counting User Agent visits from the access log for just the last 30 days

I'm trying to print a list of the most frequent visits from User Agents from the Nginx access log. I have so far come up with this: cat /var/log/nginx/access.log | awk -F\" '{print $6}' | sort | ...
0
votes
0answers
19 views

How to get the logs of a particular directory or a file in a nfs share?

Suppose I want to log the events happening in a particular file, how can I get the logs for that particular file alone? I'm using Ubuntu. I want to get the log reports in the terminal. How can I get ...
0
votes
0answers
66 views

How to run custom script on local login failure in a screen locking program using PAM

I am trying to run a script every time a login failure occurs via a screen locking program (like SLiM, i3Lock, slock, etc.) I am running Arch. Also, to be clear, I am not talking about logging into ...
0
votes
2answers
57 views

Would GREP work to filter a log file based on keywords, dates, timestamps? Or is there a better alternative?

I am trying to filter a log file based on the following: date range of an error (yyyy-mm-dd) timestamp range of an error (01:00:00 - 00:00:00) keywords (previousFireTime, nextFireTime) I've been ...
1
vote
2answers
24 views

Pump command output as function argument

I have this extremely simple function in my script: # Used for debug tracing. log() { : echo "log: $1" } The idea is to be able to customize/turn off logging at a single place. Very crude. ...
1
vote
1answer
57 views

Script calling ssh; want to create log on local machine

I need to create a script which logs into all the servers listed in servers.txt. I want to use password, no passwordless. After logging in, I need to set a variable and perform an if- then- else.  ...
2
votes
1answer
35 views

Track memory allocations on Linux

Is there a way to track memory allocations performed by kernel? I've found an article, where memory allocations are tracked in kernel log (I guess). Here is how it looks like: [ 3830.215613] [...
0
votes
1answer
26 views

Can FIFO or other thing not block on writer's access, and instead just drop data?

FIFO is problematic in use because both reader and writer have to open it – if one of them is being late, the other one is blocked inside the operating system. I have to implement a publishing ...
2
votes
2answers
72 views

How to find if a USB has been plugged in on a certain date? (Linux/Mac)

Starting from this great script offered by Daniel Azuelos cd /Volumes/suspicious_USB /usr/bin/sudo find . -atime -21 -exec ls -dluT {} \; How is it possible to modify it in order to find if a USB ...
0
votes
0answers
34 views

Log sysctl changes to a particular variable

Is there any way I can log (preferably only a particular variable, vm.swappiness) because I want to find when and what changes vm.swappiness value to 1 during boot even though I have configured it to ...
1
vote
1answer
113 views

Is there a place where FTP transfers are logged?

Ok, let's say I am responsible for old application that I don't really know the details of, I am trying to secure my server, and someone suggested to forbid the 21 port that used for FTP. But I am ...