rsyslog过滤邮件内容和设施

我find了一些基于rsyslog日志条目内容的例子。 但有没有办法做到这一点,所以它只是过滤某个设施的内容? 比如像这样的东西:

if local0.* msg contains "foo" 

但用一个真正的语法,而不是我刚刚编造的。

您需要在一行上执行两个顺序filter,而不是两个filter。

:msg, contains, "some-text"
if $syslogfacility-text == "facility" then /var/log/somelog.log
~

编辑:

我收回之前说过的话。 我现在已经看到了这两种方式。 我刚刚在rsyslog Wiki中find了这个应该可以修改的例子。

if $programname == 'popa3d' and $syslogseverity <= '6' then /var/log/popa3d.log

你当然会用你的条件代替这个例子。

if $syslogfacility-text == 'local0' and $msg contains 'some-text' then /var/log/somelog.log
& ~

Rsyslog Wiki
Rsyslog文件