[rsyslog-notify] Forum Thread: Basic configuration problem - (Mode 'post')
noreply at adiscon.com
noreply at adiscon.com
Tue Oct 7 17:01:20 CEST 2014
User: Lissium
Forumlink: http://kb.monitorware.com/viewtopic.php?p=24975#p24975
Message:
----------
Hi,
I modify rsyslog configuration since years, but very basically.
Now I want to do something a little smarter but I can't manage to make it
work.
I read the doc and asked to Google, but didn't found something helping me
to go to the right direction.
I mostly use Debian stable, so rsyslogd 5.8.11
I need to write into 2 different logs when messages come from one special
program.
Every messages into /var/log/myprog.log
Only warning+error+etc into /var/log/myprog-warn.log
I create /etc/rsyslog.d/myprog.conf :
[code:1pe1eckg]
if $programname == 'myprog' and $syslogseverity-text == 'warning' then
-/var/log/myprog-warn.log
if $programname == 'myprog' and $syslogseverity-text == 'err' then
-/var/log/myprog-warn.log
if $programname == 'myprog' then
-/var/log/myprog.log
if $programname == 'myprog' ~
[/code:1pe1eckg]
This configuration works correctly.
First, I'd like to use only one line for warnings and errors. This kind:
[code:1pe1eckg]
if $programname == 'myprog' and $syslogseverity-text >= 'warning' then
-/var/log/myprog-warn.log
[/code:1pe1eckg]
But the >= operator doesn't work (no error, just doesn't work).
What is the correct syntax to capture warnings and higher ?
More information about the rsyslog-notify
mailing list