
Estou procurando uma maneira de escrever uma única regra com vários valores de correspondência. Não grave essas linhas no arquivo de log se a mensagem contiver a primeira ou a segunda palavra.
Isso funciona, mas não está SECO:
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 }
este não funciona:
if $msg contains "WARNING: || IGNORE THIS MESSAGE:" then { Action (type="omfile" File="/var/log/ignorethis") stop }
Responder1
Isto funciona?
if ($msg contains "WARNING:") or ($msg contains "IGNORE THIS MESSAGE:") then { Action (type="omfile" File="/var/log/ignorethis") stop }
Odocumentação de expressão rsyslogpode ajudar um pouco.