Discussion:
[rsyslog] Help with filters
Alexandr Kobzarenko
2012-10-08 11:24:11 UTC
Permalink
Hi all !
Try rsyslog and wery glad to use it.
But can add some filter in config!

now i whant do 2 filters on my logs, example

if ($hostname == "IKOBZARXP") then {
if ($syslogseverity == 3) then {
:ommysql:localhost,Syslog,syslog,passwoed
:ommail:;mailBody
}else{
:ommysql:localhost,Syslog,syslog,passwoed
}

}


But have a error


Oct 8 14:23:16 logs rsyslogd: warning: selector line without actions will be discarded
Oct 8 14:23:16 logs rsyslogd-3000: unknown priority name ""
Oct 8 14:23:16 logs rsyslogd: the last error occured in /usr/local/etc/rsyslog.conf, line 80:" } "
Oct 8 14:23:16 logs rsyslogd: warning: selector line without actions will be discarded
Oct 8 14:23:16 logs rsyslogd-3000: unknown priority name ""
Oct 8 14:23:16 logs rsyslogd: the last error occured in /usr/local/etc/rsyslog.conf, line 81:"} "
Oct 8 14:23:16 logs rsyslogd: warning: selector line without actions will be discarded
Oct 8 14:23:16 logs rsyslogd-2124: CONFIG ERROR: could not interpret master config file '/usr/local/etc/rsyslog.conf'. [try http://www.rsyslog.com/e/2124 ]


Say me how do this true?
Rainer Gerhards
2012-10-08 11:31:55 UTC
Permalink
-----Original Message-----
From: rsyslog-bounces at lists.adiscon.com [mailto:rsyslog-
bounces at lists.adiscon.com] On Behalf Of Alexandr Kobzarenko
Sent: Monday, October 08, 2012 1:24 PM
To: rsyslog at lists.adiscon.com
Subject: [rsyslog] Help with filters
Hi all !
Try rsyslog and wery glad to use it.
But can add some filter in config!
now i whant do 2 filters on my logs, example
if ($hostname == "IKOBZARXP") then {
if ($syslogseverity == 3) then {
:ommysql:localhost,Syslog,syslog,passwoed
:ommail:;mailBody
}else{
:ommysql:localhost,Syslog,syslog,passwoed
}
}
You need a recent v7 version to do this type of config. The error messages tell you have an older version. I suggest updating to v7.

Rainer
But have a error
Oct 8 14:23:16 logs rsyslogd: warning: selector line without actions will be discarded
Oct 8 14:23:16 logs rsyslogd-3000: unknown priority name ""
Oct 8 14:23:16 logs rsyslogd: the last error occured in
/usr/local/etc/rsyslog.conf, line 80:" } "
Oct 8 14:23:16 logs rsyslogd: warning: selector line without actions will be discarded
Oct 8 14:23:16 logs rsyslogd-3000: unknown priority name ""
Oct 8 14:23:16 logs rsyslogd: the last error occured in
/usr/local/etc/rsyslog.conf, line 81:"} "
Oct 8 14:23:16 logs rsyslogd: warning: selector line without actions will be discarded
Oct 8 14:23:16 logs rsyslogd-2124: CONFIG ERROR: could not interpret
master config file '/usr/local/etc/rsyslog.conf'. [try
http://www.rsyslog.com/e/2124 ]
Say me how do this true?
_______________________________________________
rsyslog mailing list
http://lists.adiscon.net/mailman/listinfo/rsyslog
http://www.rsyslog.com/professional-services/
What's up with rsyslog? Follow https://twitter.com/rgerhards
NOTE WELL: This is a PUBLIC mailing list, posts are ARCHIVED by a
myriad of sites beyond our control. PLEASE UNSUBSCRIBE and DO NOT POST
if you DON'T LIKE THAT.
Alexandr Kobzarenko
2012-10-08 11:42:48 UTC
Permalink
I am used freebSD 9.0 and i have only 6 version (now i update to 6). I dont want install rsyslog from svn. i want used my system install.
How i can do this filter on 6 version?

--- ???????? ????????? ---
?? ????: "Rainer Gerhards" <rgerhards at hq.adiscon.com>
????: "rsyslog-users" <rsyslog at lists.adiscon.com>
????: 8 ??????? 2012, 14:31:59
????: Re: [rsyslog] Help with filters
Post by Rainer Gerhards
-----Original Message-----
From: rsyslog-bounces at lists.adiscon.com [rsyslog-
bounces at lists.adiscon.com] On Behalf Of Alexandr Kobzarenko
Sent: Monday, October 08, 2012 1:24 PM
To: rsyslog at lists.adiscon.com
Subject: [rsyslog] Help with filters
Hi all !
Try rsyslog and wery glad to use it.
But can add some filter in config!
now i whant do 2 filters on my logs, example
if ($hostname == "IKOBZARXP") then {
if ($syslogseverity == 3) then {
:ommysql:localhost,Syslog,syslog,passwoed
:ommail:;mailBody
}else{
:ommysql:localhost,Syslog,syslog,passwoed
}
}
You need a recent v7 version to do this type of config. The error messages tell you have an older version. I suggest updating to v7.
Rainer
But have a error
Oct 8 14:23:16 logs rsyslogd: warning: selector line without actions will be discarded
Oct 8 14:23:16 logs rsyslogd-3000: unknown priority name ""
Oct 8 14:23:16 logs rsyslogd: the last error occured in
/usr/local/etc/rsyslog.conf, line 80:" } "
Oct 8 14:23:16 logs rsyslogd: warning: selector line without actions will be discarded
Oct 8 14:23:16 logs rsyslogd-3000: unknown priority name ""
Oct 8 14:23:16 logs rsyslogd: the last error occured in
/usr/local/etc/rsyslog.conf, line 81:"} "
Oct 8 14:23:16 logs rsyslogd: warning: selector line without actions will be discarded
Oct 8 14:23:16 logs rsyslogd-2124: CONFIG ERROR: could not interpret
master config file '/usr/local/etc/rsyslog.conf'. [try
http://www.rsyslog.com/e/2124 ]
Say me how do this true?
_______________________________________________
rsyslog mailing list
http://lists.adiscon.net/mailman/listinfo/rsyslog
http://www.rsyslog.com/professional-services/
What's up with rsyslog? Follow https://twitter.com/rgerhards
NOTE WELL: This is a PUBLIC mailing list, posts are ARCHIVED by a
myriad of sites beyond our control. PLEASE UNSUBSCRIBE and DO NOT POST
if you DON'T LIKE THAT.
_______________________________________________
rsyslog mailing list
http://lists.adiscon.net/mailman/listinfo/rsyslog
http://www.rsyslog.com/professional-services/
What's up with rsyslog? Follow https://twitter.com/rgerhards
NOTE WELL: This is a PUBLIC mailing list, posts are ARCHIVED by a myriad of sites beyond our control. PLEASE UNSUBSCRIBE and DO NOT POST if you DON'T LIKE THAT.
Philippe Muller
2012-10-08 12:23:25 UTC
Permalink
Hi Alexandr,

Try:

# Write all messages from IKOBZARXP to mysql
if $hostname == "IKOBZARXP" then :ommysql:localhost,Syslog,syslog,passwoed

# send all error messages from IKOBZARXP by e-mail
if ($hostname == "IKOBZARXP" and $syslogseverity == 3) then
:ommail:;mailBody

By the way, $syslogseverity == 3 only matches messages with the error
severity.
If you want error messages and more critical messages, use <= 3
Post by Alexandr Kobzarenko
I am used freebSD 9.0 and i have only 6 version (now i update to 6). I
dont want install rsyslog from svn. i want used my system install.
How i can do this filter on 6 version?
--- ???????? ????????? ---
?? ????: "Rainer Gerhards" <rgerhards at hq.adiscon.com>
????: "rsyslog-users" <rsyslog at lists.adiscon.com>
????: 8 ??????? 2012, 14:31:59
????: Re: [rsyslog] Help with filters
Post by Rainer Gerhards
-----Original Message-----
From: rsyslog-bounces at lists.adiscon.com [rsyslog-
bounces at lists.adiscon.com] On Behalf Of Alexandr Kobzarenko
Sent: Monday, October 08, 2012 1:24 PM
To: rsyslog at lists.adiscon.com
Subject: [rsyslog] Help with filters
Hi all !
Try rsyslog and wery glad to use it.
But can add some filter in config!
now i whant do 2 filters on my logs, example
if ($hostname == "IKOBZARXP") then {
if ($syslogseverity == 3) then {
:ommysql:localhost,Syslog,syslog,passwoed
:ommail:;mailBody
}else{
:ommysql:localhost,Syslog,syslog,passwoed
}
}
You need a recent v7 version to do this type of config. The error
messages tell you have an older version. I suggest updating to v7.
Post by Rainer Gerhards
Rainer
But have a error
Oct 8 14:23:16 logs rsyslogd: warning: selector line without actions
will be discarded
Oct 8 14:23:16 logs rsyslogd-3000: unknown priority name ""
Oct 8 14:23:16 logs rsyslogd: the last error occured in
/usr/local/etc/rsyslog.conf, line 80:" } "
Oct 8 14:23:16 logs rsyslogd: warning: selector line without actions
will be discarded
Oct 8 14:23:16 logs rsyslogd-3000: unknown priority name ""
Oct 8 14:23:16 logs rsyslogd: the last error occured in
/usr/local/etc/rsyslog.conf, line 81:"} "
Oct 8 14:23:16 logs rsyslogd: warning: selector line without actions
will be discarded
Oct 8 14:23:16 logs rsyslogd-2124: CONFIG ERROR: could not interpret
master config file '/usr/local/etc/rsyslog.conf'. [try
http://www.rsyslog.com/e/2124 ]
Say me how do this true?
_______________________________________________
rsyslog mailing list
http://lists.adiscon.net/mailman/listinfo/rsyslog
http://www.rsyslog.com/professional-services/
What's up with rsyslog? Follow https://twitter.com/rgerhards
NOTE WELL: This is a PUBLIC mailing list, posts are ARCHIVED by a
myriad of sites beyond our control. PLEASE UNSUBSCRIBE and DO NOT POST
if you DON'T LIKE THAT.
_______________________________________________
rsyslog mailing list
http://lists.adiscon.net/mailman/listinfo/rsyslog
http://www.rsyslog.com/professional-services/
What's up with rsyslog? Follow https://twitter.com/rgerhards
NOTE WELL: This is a PUBLIC mailing list, posts are ARCHIVED by a myriad
of sites beyond our control. PLEASE UNSUBSCRIBE and DO NOT POST if you
DON'T LIKE THAT.
_______________________________________________
rsyslog mailing list
http://lists.adiscon.net/mailman/listinfo/rsyslog
http://www.rsyslog.com/professional-services/
What's up with rsyslog? Follow https://twitter.com/rgerhards
NOTE WELL: This is a PUBLIC mailing list, posts are ARCHIVED by a myriad
of sites beyond our control. PLEASE UNSUBSCRIBE and DO NOT POST if you
DON'T LIKE THAT.
Alexandr Kobzarenko
2012-10-08 12:36:16 UTC
Permalink
After I installed version 6, it took a lot of mistakes.
But you do not fully understand what I want.
I whant do:
All logs from IKOBZARXP wroute to my SQL DB, but if in log for this PC i cee ERROR, then
wroute to SQL_DB + MAIL
NOw in my config i do this
f ($hostname == 'IKOBZARXP' and $syslogseverity == 3) then {
:ommysql:localhost,Syslog,syslog,password
:ommail:;mailBody
}
End this scheme is worked, but how i can add second if ?
exampe

if $hostname == 'IKOBZARXP' then {
if $syslogseverity == 3 then {
:ommysql:localhost,Syslog,syslog,password
:ommail:;mailBody
}else {
:ommysql:localhost,Syslog,syslog,password
}
}

????
Post by Philippe Muller
Hi Alexandr,
# Write all messages from IKOBZARXP to mysql
if $hostname == "IKOBZARXP" then :ommysql:localhost,Syslog,syslog,passwoed
# send all error messages from IKOBZARXP by e-mail
if ($hostname == "IKOBZARXP" and $syslogseverity == 3) then
:ommail:;mailBody
By the way, $syslogseverity == 3 only matches messages with the error
severity.
If you want error messages and more critical messages, use <= 3
Post by Alexandr Kobzarenko
I am used freebSD 9.0 and i have only 6 version (now i update to 6). I
dont want install rsyslog from svn. i want used my system install.
How i can do this filter on 6 version?
--- ???????? ????????? ---
?? ????: "Rainer Gerhards" <rgerhards at hq.adiscon.com>
????: "rsyslog-users" <rsyslog at lists.adiscon.com>
????: 8 ??????? 2012, 14:31:59
????: Re: [rsyslog] Help with filters
Post by Rainer Gerhards
-----Original Message-----
From: rsyslog-bounces at lists.adiscon.com [rsyslog-
bounces at lists.adiscon.com] On Behalf Of Alexandr Kobzarenko
Sent: Monday, October 08, 2012 1:24 PM
To: rsyslog at lists.adiscon.com
Subject: [rsyslog] Help with filters
Hi all !
Try rsyslog and wery glad to use it.
But can add some filter in config!
now i whant do 2 filters on my logs, example
if ($hostname == "IKOBZARXP") then {
if ($syslogseverity == 3) then {
:ommysql:localhost,Syslog,syslog,passwoed
:ommail:;mailBody
}else{
:ommysql:localhost,Syslog,syslog,passwoed
}
}
You need a recent v7 version to do this type of config. The error
messages tell you have an older version. I suggest updating to v7.
Post by Rainer Gerhards
Rainer
But have a error
Oct 8 14:23:16 logs rsyslogd: warning: selector line without actions
will be discarded
Oct 8 14:23:16 logs rsyslogd-3000: unknown priority name ""
Oct 8 14:23:16 logs rsyslogd: the last error occured in
/usr/local/etc/rsyslog.conf, line 80:" } "
Oct 8 14:23:16 logs rsyslogd: warning: selector line without actions
will be discarded
Oct 8 14:23:16 logs rsyslogd-3000: unknown priority name ""
Oct 8 14:23:16 logs rsyslogd: the last error occured in
/usr/local/etc/rsyslog.conf, line 81:"} "
Oct 8 14:23:16 logs rsyslogd: warning: selector line without actions
will be discarded
Oct 8 14:23:16 logs rsyslogd-2124: CONFIG ERROR: could not interpret
master config file '/usr/local/etc/rsyslog.conf'. [try
http://www.rsyslog.com/e/2124 ]
Say me how do this true?
_______________________________________________
rsyslog mailing list
http://lists.adiscon.net/mailman/listinfo/rsyslog
http://www.rsyslog.com/professional-services/
What's up with rsyslog? Follow https://twitter.com/rgerhards
NOTE WELL: This is a PUBLIC mailing list, posts are ARCHIVED by a
myriad of sites beyond our control. PLEASE UNSUBSCRIBE and DO NOT POST
if you DON'T LIKE THAT.
_______________________________________________
rsyslog mailing list
http://lists.adiscon.net/mailman/listinfo/rsyslog
http://www.rsyslog.com/professional-services/
What's up with rsyslog? Follow https://twitter.com/rgerhards
NOTE WELL: This is a PUBLIC mailing list, posts are ARCHIVED by a myriad
of sites beyond our control. PLEASE UNSUBSCRIBE and DO NOT POST if you
DON'T LIKE THAT.
_______________________________________________
rsyslog mailing list
http://lists.adiscon.net/mailman/listinfo/rsyslog
http://www.rsyslog.com/professional-services/
What's up with rsyslog? Follow https://twitter.com/rgerhards
NOTE WELL: This is a PUBLIC mailing list, posts are ARCHIVED by a myriad
of sites beyond our control. PLEASE UNSUBSCRIBE and DO NOT POST if you
DON'T LIKE THAT.
_______________________________________________
rsyslog mailing list
http://lists.adiscon.net/mailman/listinfo/rsyslog
http://www.rsyslog.com/professional-services/
What's up with rsyslog? Follow https://twitter.com/rgerhards
NOTE WELL: This is a PUBLIC mailing list, posts are ARCHIVED by a myriad of sites beyond our control. PLEASE UNSUBSCRIBE and DO NOT POST if you DON'T LIKE THAT.
Bob Bregant II
2012-10-08 13:20:00 UTC
Permalink
Alexandr,

If you include both of the blocks that Phillipe gave you, that behavior is exactly what you should get. There is no discard action in the first block, so messages that match it will still be evaluated by the second one and can potentially get both actions applied (if they are from that host and are severity 3).

Because the nested "if" isn't possible in v6, as I understand it, using logic such as has been provided is your best choice. The provided configuration is logically equivalent, but avoids that nested if statement.

--

Bob
Post by Alexandr Kobzarenko
After I installed version 6, it took a lot of mistakes.
But you do not fully understand what I want.
All logs from IKOBZARXP wroute to my SQL DB, but if in log for this PC i cee ERROR, then
wroute to SQL_DB + MAIL
NOw in my config i do this
f ($hostname == 'IKOBZARXP' and $syslogseverity == 3) then {
:ommysql:localhost,Syslog,syslog,password
:ommail:;mailBody
}
End this scheme is worked, but how i can add second if ?
exampe
if $hostname == 'IKOBZARXP' then {
if $syslogseverity == 3 then {
:ommysql:localhost,Syslog,syslog,password
:ommail:;mailBody
}else {
:ommysql:localhost,Syslog,syslog,password
}
}
????
Post by Philippe Muller
Hi Alexandr,
# Write all messages from IKOBZARXP to mysql
if $hostname == "IKOBZARXP" then
:ommysql:localhost,Syslog,syslog,passwoed
Post by Philippe Muller
# send all error messages from IKOBZARXP by e-mail
if ($hostname == "IKOBZARXP" and $syslogseverity == 3) then
:ommail:;mailBody
By the way, $syslogseverity == 3 only matches messages with the error
severity.
If you want error messages and more critical messages, use <= 3
On Mon, Oct 8, 2012 at 1:42 PM, Alexandr Kobzarenko <puzo at ukr.net>
Post by Alexandr Kobzarenko
I am used freebSD 9.0 and i have only 6 version (now i update to
6). I
Post by Philippe Muller
Post by Alexandr Kobzarenko
dont want install rsyslog from svn. i want used my system install.
How i can do this filter on 6 version?
--- ???????? ????????? ---
?? ????: "Rainer Gerhards" <rgerhards at hq.adiscon.com>
????: "rsyslog-users" <rsyslog at lists.adiscon.com>
????: 8 ??????? 2012, 14:31:59
????: Re: [rsyslog] Help with filters
Post by Rainer Gerhards
-----Original Message-----
From: rsyslog-bounces at lists.adiscon.com [rsyslog-
bounces at lists.adiscon.com] On Behalf Of Alexandr Kobzarenko
Sent: Monday, October 08, 2012 1:24 PM
To: rsyslog at lists.adiscon.com
Subject: [rsyslog] Help with filters
Hi all !
Try rsyslog and wery glad to use it.
But can add some filter in config!
now i whant do 2 filters on my logs, example
if ($hostname == "IKOBZARXP") then {
if ($syslogseverity == 3) then {
:ommysql:localhost,Syslog,syslog,passwoed
Post by Philippe Muller
Post by Alexandr Kobzarenko
Post by Rainer Gerhards
:ommail:;mailBody
}else{
:ommysql:localhost,Syslog,syslog,passwoed
Post by Philippe Muller
Post by Alexandr Kobzarenko
Post by Rainer Gerhards
}
}
You need a recent v7 version to do this type of config. The error
messages tell you have an older version. I suggest updating to v7.
Post by Rainer Gerhards
Rainer
But have a error
Oct 8 14:23:16 logs rsyslogd: warning: selector line without
actions
Post by Philippe Muller
Post by Alexandr Kobzarenko
Post by Rainer Gerhards
will be discarded
Oct 8 14:23:16 logs rsyslogd-3000: unknown priority name ""
Oct 8 14:23:16 logs rsyslogd: the last error occured in
/usr/local/etc/rsyslog.conf, line 80:" } "
Oct 8 14:23:16 logs rsyslogd: warning: selector line without
actions
Post by Philippe Muller
Post by Alexandr Kobzarenko
Post by Rainer Gerhards
will be discarded
Oct 8 14:23:16 logs rsyslogd-3000: unknown priority name ""
Oct 8 14:23:16 logs rsyslogd: the last error occured in
/usr/local/etc/rsyslog.conf, line 81:"} "
Oct 8 14:23:16 logs rsyslogd: warning: selector line without
actions
Post by Philippe Muller
Post by Alexandr Kobzarenko
Post by Rainer Gerhards
will be discarded
Oct 8 14:23:16 logs rsyslogd-2124: CONFIG ERROR: could not
interpret
Post by Philippe Muller
Post by Alexandr Kobzarenko
Post by Rainer Gerhards
master config file '/usr/local/etc/rsyslog.conf'. [try
http://www.rsyslog.com/e/2124 ]
Say me how do this true?
_______________________________________________
rsyslog mailing list
http://lists.adiscon.net/mailman/listinfo/rsyslog
http://www.rsyslog.com/professional-services/
What's up with rsyslog? Follow https://twitter.com/rgerhards
NOTE WELL: This is a PUBLIC mailing list, posts are ARCHIVED by
a
Post by Philippe Muller
Post by Alexandr Kobzarenko
Post by Rainer Gerhards
myriad of sites beyond our control. PLEASE UNSUBSCRIBE and DO
NOT POST
Post by Philippe Muller
Post by Alexandr Kobzarenko
Post by Rainer Gerhards
if you DON'T LIKE THAT.
_______________________________________________
rsyslog mailing list
http://lists.adiscon.net/mailman/listinfo/rsyslog
http://www.rsyslog.com/professional-services/
What's up with rsyslog? Follow https://twitter.com/rgerhards
NOTE WELL: This is a PUBLIC mailing list, posts are ARCHIVED by a
myriad
Post by Philippe Muller
Post by Alexandr Kobzarenko
of sites beyond our control. PLEASE UNSUBSCRIBE and DO NOT POST if
you
Post by Philippe Muller
Post by Alexandr Kobzarenko
DON'T LIKE THAT.
_______________________________________________
rsyslog mailing list
http://lists.adiscon.net/mailman/listinfo/rsyslog
http://www.rsyslog.com/professional-services/
What's up with rsyslog? Follow https://twitter.com/rgerhards
NOTE WELL: This is a PUBLIC mailing list, posts are ARCHIVED by a
myriad
Post by Philippe Muller
Post by Alexandr Kobzarenko
of sites beyond our control. PLEASE UNSUBSCRIBE and DO NOT POST if
you
Post by Philippe Muller
Post by Alexandr Kobzarenko
DON'T LIKE THAT.
_______________________________________________
rsyslog mailing list
http://lists.adiscon.net/mailman/listinfo/rsyslog
http://www.rsyslog.com/professional-services/
What's up with rsyslog? Follow https://twitter.com/rgerhards
NOTE WELL: This is a PUBLIC mailing list, posts are ARCHIVED by a
myriad of sites beyond our control. PLEASE UNSUBSCRIBE and DO NOT POST
if you DON'T LIKE THAT.
_______________________________________________
rsyslog mailing list
http://lists.adiscon.net/mailman/listinfo/rsyslog
http://www.rsyslog.com/professional-services/
What's up with rsyslog? Follow https://twitter.com/rgerhards
NOTE WELL: This is a PUBLIC mailing list, posts are ARCHIVED by a
myriad of sites beyond our control. PLEASE UNSUBSCRIBE and DO NOT POST
if you DON'T LIKE THAT.
Alexandr Kobzarenko
2012-10-08 13:53:05 UTC
Permalink
10x to all!
NOw i do this:

#Filter to TEST
if ($hostname == 'IKOBZARXP' and $syslogseverity <= 3) then {
:ommail:;mailBody
}
if ($hostname == 'IKOBZARXP') then {
:ommysql:localhost,Syslog,syslog,password
}

And all working good!
But in console i have some warning messages

Oct 8 16:49:37 logs rsyslogd: [origin software="rsyslogd" swVersion="6.4.2" x-pid="60839" x-info="http://www.rsyslog.com"] exiting on signal 15.
Oct 8 16:49:42 logs rsyslogd: [origin software="rsyslogd" swVersion="6.4.2" x-pid="60855" x-info="http://www.rsyslog.com"] start
Oct 8 16:49:42 logs rsyslogd-2184: action '*' treated as ':omusrmsg:*' - please change syntax, '*' will not be supported in the future [try http://www.rsyslog.com/e/2184 ]
Oct 8 16:49:42 logs rsyslogd: the last warning occured in /usr/local/etc/rsyslog.conf, line 56:"*"
Oct 8 16:49:42 logs rsyslogd-2071: no recipient address given - specify $ActionMailTo [try http://www.rsyslog.com/e/2071 ]
Oct 8 16:49:42 logs rsyslogd: the last error occured in /usr/local/etc/rsyslog.conf, line 72:":ommail:;mailBody"
Oct 8 16:49:42 logs rsyslogd: warning: selector line without actions will be discarded
Oct 8 16:49:42 logs rsyslogd-2071: no recipient address given - specify $ActionMailTo [try http://www.rsyslog.com/e/2071 ]
Oct 8 16:49:42 logs rsyslogd: the last error occured in /usr/local/etc/rsyslog.conf, line 79:":ommail:;mailBody"
Oct 8 16:49:42 logs rsyslogd: warning: selector line without actions will be discarded
Oct 8 16:49:42 logs rsyslogd-2071: no recipient address given - specify $ActionMailTo [try http://www.rsyslog.com/e/2071 ]
Oct 8 16:49:42 logs rsyslogd: the last error occured in /usr/local/etc/rsyslog.conf, line 86:":ommail:;mailBody"
Oct 8 16:49:42 logs rsyslogd: warning: selector line without actions will be discarded
Oct 8 16:49:42 logs rsyslogd: imudp: cannot set thread scheduling policy, pthread_setschedparam() not available

But all my rules working fine !
Post by Philippe Muller
Alexandr,
If you include both of the blocks that Phillipe gave you, that behavior is exactly what you should get. There is no discard action in the first block, so messages that match it will still be evaluated by the second one and can potentially get both actions applied (if they are from that host and are severity 3).
Because the nested "if" isn't possible in v6, as I understand it, using logic such as has been provided is your best choice. The provided configuration is logically equivalent, but avoids that nested if statement.
--
Bob
Post by Alexandr Kobzarenko
After I installed version 6, it took a lot of mistakes.
But you do not fully understand what I want.
All logs from IKOBZARXP wroute to my SQL DB, but if in log for this PC i cee ERROR, then
wroute to SQL_DB + MAIL
NOw in my config i do this
f ($hostname == 'IKOBZARXP' and $syslogseverity == 3) then {
:ommysql:localhost,Syslog,syslog,password
:ommail:;mailBody
}
End this scheme is worked, but how i can add second if ?
exampe
if $hostname == 'IKOBZARXP' then {
if $syslogseverity == 3 then {
:ommysql:localhost,Syslog,syslog,password
:ommail:;mailBody
}else {
:ommysql:localhost,Syslog,syslog,password
}
}
????
Post by Philippe Muller
Hi Alexandr,
# Write all messages from IKOBZARXP to mysql
if $hostname == "IKOBZARXP" then
:ommysql:localhost,Syslog,syslog,passwoed
Post by Philippe Muller
# send all error messages from IKOBZARXP by e-mail
if ($hostname == "IKOBZARXP" and $syslogseverity == 3) then
:ommail:;mailBody
By the way, $syslogseverity == 3 only matches messages with the error
severity.
If you want error messages and more critical messages, use <= 3
On Mon, Oct 8, 2012 at 1:42 PM, Alexandr Kobzarenko <puzo at ukr.net>
Post by Alexandr Kobzarenko
I am used freebSD 9.0 and i have only 6 version (now i update to
6). I
Post by Philippe Muller
Post by Alexandr Kobzarenko
dont want install rsyslog from svn. i want used my system install.
How i can do this filter on 6 version?
--- ???????? ????????? ---
?? ????: "Rainer Gerhards" <rgerhards at hq.adiscon.com>
????: "rsyslog-users" <rsyslog at lists.adiscon.com>
????: 8 ??????? 2012, 14:31:59
????: Re: [rsyslog] Help with filters
Post by Rainer Gerhards
-----Original Message-----
From: rsyslog-bounces at lists.adiscon.com [rsyslog-
bounces at lists.adiscon.com] On Behalf Of Alexandr Kobzarenko
Sent: Monday, October 08, 2012 1:24 PM
To: rsyslog at lists.adiscon.com
Subject: [rsyslog] Help with filters
Hi all !
Try rsyslog and wery glad to use it.
But can add some filter in config!
now i whant do 2 filters on my logs, example
if ($hostname == "IKOBZARXP") then {
if ($syslogseverity == 3) then {
:ommysql:localhost,Syslog,syslog,passwoed
Post by Philippe Muller
Post by Alexandr Kobzarenko
Post by Rainer Gerhards
:ommail:;mailBody
}else{
:ommysql:localhost,Syslog,syslog,passwoed
Post by Philippe Muller
Post by Alexandr Kobzarenko
Post by Rainer Gerhards
}
}
You need a recent v7 version to do this type of config. The error
messages tell you have an older version. I suggest updating to v7.
Post by Rainer Gerhards
Rainer
But have a error
Oct 8 14:23:16 logs rsyslogd: warning: selector line without
actions
Post by Philippe Muller
Post by Alexandr Kobzarenko
Post by Rainer Gerhards
will be discarded
Oct 8 14:23:16 logs rsyslogd-3000: unknown priority name ""
Oct 8 14:23:16 logs rsyslogd: the last error occured in
/usr/local/etc/rsyslog.conf, line 80:" } "
Oct 8 14:23:16 logs rsyslogd: warning: selector line without
actions
Post by Philippe Muller
Post by Alexandr Kobzarenko
Post by Rainer Gerhards
will be discarded
Oct 8 14:23:16 logs rsyslogd-3000: unknown priority name ""
Oct 8 14:23:16 logs rsyslogd: the last error occured in
/usr/local/etc/rsyslog.conf, line 81:"} "
Oct 8 14:23:16 logs rsyslogd: warning: selector line without
actions
Post by Philippe Muller
Post by Alexandr Kobzarenko
Post by Rainer Gerhards
will be discarded
Oct 8 14:23:16 logs rsyslogd-2124: CONFIG ERROR: could not
interpret
Post by Philippe Muller
Post by Alexandr Kobzarenko
Post by Rainer Gerhards
master config file '/usr/local/etc/rsyslog.conf'. [try
http://www.rsyslog.com/e/2124 ]
Say me how do this true?
_______________________________________________
rsyslog mailing list
http://lists.adiscon.net/mailman/listinfo/rsyslog
http://www.rsyslog.com/professional-services/
What's up with rsyslog? Follow https://twitter.com/rgerhards
NOTE WELL: This is a PUBLIC mailing list, posts are ARCHIVED by
a
Post by Philippe Muller
Post by Alexandr Kobzarenko
Post by Rainer Gerhards
myriad of sites beyond our control. PLEASE UNSUBSCRIBE and DO
NOT POST
Post by Philippe Muller
Post by Alexandr Kobzarenko
Post by Rainer Gerhards
if you DON'T LIKE THAT.
_______________________________________________
rsyslog mailing list
http://lists.adiscon.net/mailman/listinfo/rsyslog
http://www.rsyslog.com/professional-services/
What's up with rsyslog? Follow https://twitter.com/rgerhards
NOTE WELL: This is a PUBLIC mailing list, posts are ARCHIVED by a
myriad
Post by Philippe Muller
Post by Alexandr Kobzarenko
of sites beyond our control. PLEASE UNSUBSCRIBE and DO NOT POST if
you
Post by Philippe Muller
Post by Alexandr Kobzarenko
DON'T LIKE THAT.
_______________________________________________
rsyslog mailing list
http://lists.adiscon.net/mailman/listinfo/rsyslog
http://www.rsyslog.com/professional-services/
What's up with rsyslog? Follow https://twitter.com/rgerhards
NOTE WELL: This is a PUBLIC mailing list, posts are ARCHIVED by a
myriad
Post by Philippe Muller
Post by Alexandr Kobzarenko
of sites beyond our control. PLEASE UNSUBSCRIBE and DO NOT POST if
you
Post by Philippe Muller
Post by Alexandr Kobzarenko
DON'T LIKE THAT.
_______________________________________________
rsyslog mailing list
http://lists.adiscon.net/mailman/listinfo/rsyslog
http://www.rsyslog.com/professional-services/
What's up with rsyslog? Follow https://twitter.com/rgerhards
NOTE WELL: This is a PUBLIC mailing list, posts are ARCHIVED by a
myriad of sites beyond our control. PLEASE UNSUBSCRIBE and DO NOT POST
if you DON'T LIKE THAT.
_______________________________________________
rsyslog mailing list
http://lists.adiscon.net/mailman/listinfo/rsyslog
http://www.rsyslog.com/professional-services/
What's up with rsyslog? Follow https://twitter.com/rgerhards
NOTE WELL: This is a PUBLIC mailing list, posts are ARCHIVED by a
myriad of sites beyond our control. PLEASE UNSUBSCRIBE and DO NOT POST
if you DON'T LIKE THAT.
Continue reading on narkive:
Loading...