我正在寻找一种方法来编写具有多个匹配值的单个规则,如果消息包含第一个单词或第二个单词,请不要将这些行写入日志文件。
这有效但不干燥:
if $msg contains "WARNING:" then { Action (type="omfile" File="/var/log/ignorethis") stop }
if $msg contains "IGNORE THIS MESSAGE:" then { Action (type="omfile" File="/var/log/ignorethis") stop }
这个不起作用:
if $msg contains "WARNING: || IGNORE THIS MESSAGE:" then { Action (type="omfile" File="/var/log/ignorethis") stop }