Question on /var/log/message

General support questions
poky
Posts: 108
Joined: 2013/03/27 12:18:03

Re: Question on /var/log/message

Post by poky » 2018/02/08 17:40:08

1. This is file, which I created for disable some messages:

/etc/rsyslog.d/message-disable.conf

Code: Select all

:msg, regex, "^.*Starting Session [0-9]* of user" stop
:msg, regex, "^.*Started Session [0-9]* of user" stop
:msg, regex, "^.*New session [0-9]* of user" stop
:msg, regex, "^.*Removed session [0-9]*." stop
:msg, regex, "^.*starting 0anacron*" stop
:msg, regex, "^.*finished 0anacron*" stop
:msg, regex, "^.*starting 0yum-hourly.cron*" stop
:msg, regex, "^.*finished 0yum-hourly.cron*" stop
:msg, regex, "^.*run-parts /etc/cron.hourly*" stop

if $programname == "systemd" and \
($msg contains "Starting Session" or \
$msg contains "Started Session" or \
$msg contains "Created slice" or \
$msg contains "Starting user-" or \
$msg contains "Removed slice user-" or \
$msg contains "Stopping user-") then stop
Don't forget to restart rsyslogd.

2. You can try change the Log Level in Systemd:

Temporaly:
systemctl -pLogLevel show
systemd-analyze set-log-level notice

Permanently in files:
/etc/systemd/system.conf
/etc/systemd/user.conf

Code: Select all

#LogLevel=info
LogLevel=notice

fishface
Posts: 27
Joined: 2016/08/02 15:47:42

Re: Question on /var/log/message

Post by fishface » 2018/02/08 18:22:36

I have tried suggestion 1 and it's working great!

I'll do some further testing, but thanks! :)

jimj
Posts: 93
Joined: 2014/10/01 05:34:57

Re: Question on /var/log/message

Post by jimj » 2018/06/02 17:52:41

fishface wrote:Digging up an old thread, I have tried to suppress the following messages in the daemon.log using the filter below, but it complains there is an error, but I cannot see anything wrong with it.
CentOS 7.5 (or maybe 7.4?) must have change the case or wording for some of these messages. I updated my file with your solution and it worked fine for me, no error messages.

Post Reply