
Ich suche nach einer Möglichkeit, eine einzelne Regel mit mehreren Übereinstimmungswerten zu schreiben, die diese Zeilen nicht in die Protokolldatei schreibt, wenn die Nachricht das erste oder das zweite Wort enthält.
Das funktioniert, ist aber nicht DRY:
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 }
das hier funktioniert nicht:
if $msg contains "WARNING: || IGNORE THIS MESSAGE:" then { Action (type="omfile" File="/var/log/ignorethis") stop }
Antwort1
Funktioniert das?
if ($msg contains "WARNING:") or ($msg contains "IGNORE THIS MESSAGE:") then { Action (type="omfile" File="/var/log/ignorethis") stop }
Derrsyslog-Ausdrucksdokumentationkönnte ein wenig helfen.