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
0
votes
0answers
3 views

Sync Logfiles Online in Real Time

Background: I have a smart home device (roborock) running linux. For some reason it triggers factory resets every odd weak, presumably during reboots. I need to find out why and how to prevent it. ...
-1
votes
1answer
14 views

Tailing a file with ^[[K in front of the lines

I am logging the output of mpv to get the time stamp of the video that is playing. Whenever I try to tail -n X mpv.log, it only shows one line. If i open the files and look through it, there is ...
0
votes
0answers
45 views

How to output only certain lines from a file having the line numbers in another file? [duplicate]

I have a file with desired line numbers: 4988 5008 5028 5050 5072 5094 5116 5138 5160 5182 5204 5224 . etc . These are line numbers indexes into a log file that I have: URL : https://dc4-...
-2
votes
1answer
38 views

tail -n 10 is truncating my entire file [duplicate]

I have these 2 scripts, one is writing to the file: #!/usr/bin/env bash while true; do sleep 1; echo "$(uuidgen)" >> /tmp/cprev.stdout.log done; the other is reading the last 10 lines ...
0
votes
0answers
22 views

Script to monitor log file for when something does not happen

I’m new to this scripting thing and need some insight on a script I need to write. The script needs to monitor a server’s auth.log file. Where I work, we have a setup we call a conveyor. We have ...
2
votes
1answer
39 views

How do I send output to both log file and console?

I used to put this on top of all my scripts, with regards to the output. The stopping and starting of the docker works as expected, and the log files contain what it should but the console does not ...
0
votes
0answers
31 views

Is there something that can be done about these WARN messages or should I not worry about them?

I was using zoom and these messages popped up on my laptop's /var/log/syslog. I am using Ubuntu 19.10 on a Lenovo Thinkpad X220i. My kernel version is: 5.3.0-42-generic Mar 16 14:45:07 a thermald[617]...
0
votes
1answer
46 views

How to redirect output to a log file from cron and prepend timestamp?

Most logs on my Mac have a time stamp before the output message like this: Nov 14 17:55:24 - SoftRAID Driver: SoftRAID driver loaded, version 5.8.1. I am running an executable in cron and instead of ...
0
votes
0answers
15 views

Centos 7 x64 Server Crash log

I have Centos7x64 server with directadmin installed, last night at around 12 my server crashed, I could not event restart the server with VNC and had to ask the support to restart it for me ... I am ...
0
votes
0answers
13 views

How to record terminal session's input and output including IPython and save log to text file [duplicate]

I want to record my work session that includes working in an IPython session. I've tried using script and then exit as other answers have suggested but this produces extremely jumbled up and unclear ...
0
votes
1answer
39 views

Bash command to count lines with matching substrings in two different positions

I'm trying to get some trivial statistics on some debug output. Each debug line is of the form(class name)(delimiter 1)(object ID)(delimiter 2)(method name)(delimiter 3)(log message) I want to get a ...
0
votes
0answers
41 views

I have “deleted” /var/log folder. What can I do to repare this mistake?

My / partition vas full, so I needed to make some free space... The quickest solution I've found was to "move" /var/log to another partition and make a symbolic link to it. In fact I did a cp of the ...
0
votes
0answers
17 views

How to debug Mate keyboard shortcuts?

I want to assign two keyboard shortcuts to "media next". An interesting idea I found was to create a custom shortcut that executes xdotool key XF86AudioNext, but that does absolutely nothing. I ...
1
vote
1answer
21 views

How to log connect/disconnects of outgoing ssh sessions?

I'm looking to log connections/disconnections from outgoing ssh sessions. Is this something auditd can do? I am able to get logs via auditbeat of the connections going outbound but the tricky part is ...
0
votes
0answers
16 views

Clarification on logrotate

I'm setting up logrotate for several services, and I'm a little confused. I would like to rotate logs for 7 days, tar anything older than that, and delete anything older than 10 days. Here is my ...
0
votes
1answer
15 views

logrotate a frequently written to log without losing data

I want to capture slow queries via logrotate, and I want them to rotate weekly and I want to save a year's worth. The logs take the form: -rw-r-----. 1 mysql root 1239 Feb 21 18:46 mysqld1-...
0
votes
0answers
12 views

Linux kernel process execution with logging all IO

Is there option to have sort of proxy on executing binary file, that reads and handles all it's syscalls? I know it's KVM, but I need to access this data on what application is doing, is there open ...
0
votes
0answers
12 views

How to filter kernel parameter changes from kern.log?

I'm trying to add a use case to my SIEM where it triggers when kernel parameter change happen. I did some digging around the internet, but can't seems to find any method for filtering them from rest ...
1
vote
0answers
15 views

Keep a log of system start with GNU grub2 bootloader?

Since the GNU grub2 bootloader is able to read files from partitions and supports ext4 filesystem is there a way to make it record/log boot processes to a file? Such a log would help me enormously to ...
1
vote
2answers
77 views

Difference between /dev/log vs /dev/kmsg?

what is the actual use of /dev/log, while googling it I understand it is used for logging from userspace to Syslog. I thought /dev/kmsg is used for that role. Am I missing anything? Note: test@test:~...
0
votes
0answers
25 views

How to get thread count or CPU core load log on Linux?

Is there a way to get the log of how many threads were running or how many CPU cores were occupied over some time frame? Similar to sar logs, like: 00:00 - 150 threads (or 150 cores running out of ...
1
vote
1answer
32 views

How can I add lastlog support to Alpine Linux?

Apparently, musl, the default library for Alpine Linux does not support lastlog. Generally you will use Alpine to deploy containers that do not need that kind of support, but it could be used also to ...
8
votes
2answers
314 views

How can I get the current systemd log level and change it?

I recently came across a situation where I wanted to change my systemd's log level to debug, but wanted to make sure I set it back to what it was previously. All my searches related to this only found ...
1
vote
1answer
93 views

At what size is *.xsession-errors* turned into *.xsession-errors.old*?

My .xsession-errors file is growing steadily (which is apparently a common phenomenon) and not unexpected (I still have to address some issues on my system). Question: Is there a specific threshold ...
1
vote
0answers
17 views

Complete trace of a program

I am trying to figure out a way to write a debugger in the kernel space. I have some user space program and when I run it, I want to see its entire execution trace that happens in the kernel space. I ...
1
vote
3answers
63 views

While loop - reading two lines at a time

I am trying to parse data from a log file. Here is the datafile in: Data1 Data2 Data3 Data4 My code is as follow: data=$(cat datafile) echo "$data" | while read line; read line1; do echo "$...
1
vote
1answer
42 views

How to see previous output in terminal window?

I was running a lengthy scientific simulation (which took almost a week to run) on my Linux workstation with the command which looked like this: time ./simulation So besides getting the output files ...
2
votes
3answers
161 views

Search and find the last pattern character and print the next characters

I have file C1.log which has the following: /u01/app/oracle/dirdat/ab00cmf /u01/app/oracle/dirprm/fm00lsk I need to find the last / of every line, and then print the next two characters. For ...
1
vote
1answer
28 views

Prevent rsyslog messages from repeating in different priority levels

[Running Linux Mint 19.3] I'm trying to work with individual rsyslog priority levels, separating out the messages like this (from /etc/rsyslog.d/50-default.conf): *.info /var/...
0
votes
0answers
25 views

Can't tail file with glogg and smb/cifs

I'm trying to use glogg to tail logfiles from windows servers. It works fine while tailing my syslog, but it doesn't auto-refresh for these windows log files. I've tried to open the file directly from ...
0
votes
0answers
23 views

Anyway to provide hint to zgrep to search part of file for faster search results

Production logs file are huge in size and are stored in compressed format. I use the following to find specific log line zgrep searchString LargeLogFiles*.gz Typically this takes huge amount of ...
0
votes
0answers
28 views

compare two filename with specific string and rename 2nd if matched

I have list of log files which will generate a report file after analyzing in different directories. For example, source directory has files like abc.hostid.hostname.log and output directory has files ...
6
votes
2answers
457 views

How does logrotate work?

I'm really struggling to understand how logrotate works when running a command within a shell file of my own, and how it doesn't. The command in question is: rclone -L -vv --log-file "/home/mike/...
1
vote
0answers
18 views

Consecutive same lines are squashed into one in journal

I am running as below: % systemd-run --user python3 -c "print(1);print(1)" Running as unit: run-r9210c54561b84cdbaf4e741f5d2f3e57.service I was expecting to see two 1s in each line. But I am seeing ...
0
votes
1answer
60 views

Grep - return different line sized contents after a match

I need to find a way for grep to return different line sized contents after a match. Some matches have 4 lines after them, other have 20. I need them all. Every hour I am looking to return the ...
2
votes
2answers
38 views

Get last X minutes of log file that has particular timestamping

I am trying to go through an IPA host's log file to grab the last five minutes of content and get updates on things like new user creations or DNS changes. I want to cron this so every five minutes it ...
0
votes
1answer
71 views

Tail a live log file and output match contents to an e-mail

So far with: #!/bin/bash tail -fn0 /var/log/dirsrv/redacted-domain/audit | \ while read line ; do echo "$line" | grep -C 5 -i "add: member" if [ $? = 0 ] then ...
1
vote
0answers
26 views

What happens to rsyslog queue files after they have been processed?

I am working on a machine (ubuntu 18.04) that generates logs at times when it's not connected to a network. I have configured rsyslog to forward some of these logs to an aggregator service (fluentd) ...
1
vote
0answers
20 views

Log user status (archlinux)

I'd like to write a code that restricts myself from accessing the laptop for too long. To do that, I have to have access to user's active time. Currently, I use ac (a part of GNU accounting utils) to ...
1
vote
0answers
21 views

Which systemd unit failed at “some time in the past”?

I have a monitoring system on my server that indicates that some systemd unit did fail at a certain time yesterday. Now I want to ask systemctl/journalctl which unit that was and see its logs. My ...
1
vote
1answer
82 views

Cronjobs not running. Cron daemon not working

First of all, the server specs: VPS - OpenVZ, Ubuntu 14, Kernel 3.10 Now, it appears that the cron daemon is not running ANY crojobs at all and i cannot find out why. I tried: Rebooting the server....
-1
votes
1answer
53 views

openSUSE: “Permission denied” error on Cron log file

using: openSUSE Leap 42.2 /etc/cron.d/mysite file content: * * * * * wwwrun /usr/bin/php /srv/www/mysite/cron.php >> /var/log/apache2/mysite.cron 2>&1 /etc/cron.d/ dir content: /etc/...
0
votes
2answers
60 views

Force the stdout, stderr logging with timestamp

I have a Raspberry-Pi based device that takes input from switches and sensors connected to its GPIO, as well as from Arduino connected via TTY serial. The main app managing all this is written in ...
0
votes
0answers
38 views

journalctl - How to clear until last boot?

I'm aware of journalctl's vacuum-time, vacuum-size and vacuum-files. Is there a way to do vacuum-boot or something similar? Yes, this can be accomplished by specifying a specific time, however, pin ...
0
votes
0answers
18 views

How does one log openprocess, Read/WriteProcessMemory in Wine

We are trying to get a program that does open process and tons of Read/WriteProcessMemory to work properly on wine. For that we need to log instances of that working/failing/being done, but I ...
0
votes
0answers
33 views

Unauthorized device is connected to my terminal [duplicate]

I connected my MacBook in a public cafe network at around 15:24 and when I opened terminal at 16:36 I saw that the terminal said "deniz@Galaxy-A70 - %" where it normally says "deniz@MacBook Pro - %". ...
1
vote
1answer
140 views

How to check if 'date time' timestamp between two 'date time' timestamps

I have searched and found several ways to check if a timestamp is between two timestamps but all methods assume HH:MM:SS format only, not taking into account date. My real life scenario is timestamps ...
0
votes
0answers
5 views

Detect/hook SCSI reset event

How can I set up a command to be triggered on an SCSI reset of a specific device (e.g. to power cycle a drive that usually can't recover with a reset). I could leave a thread to parse dmesg and ...
0
votes
1answer
38 views

Top 10 IP by request across two nodes

I have two web servers, and I want to know the top 10 ips sorted by the number of requests. The webservers are Apache based, so I need to look at an access.log file. The problem is since these files ...
0
votes
1answer
164 views

Haproxy seems to not send logs to 127.0.0.1:514 despite configuration

Edit: the actual problem ended up being either the local0 vs local2 distinction and the rsyslog end of deal. I'm building a kubernetes / openshift cluster, and on front of that, I need to set up a L4 ...

1
2 3 4 5
32