log-forward: use $EscapeForRegEx

This commit is contained in:
Christian Hesse 2021-03-17 08:55:33 +01:00
parent 7c4ab95394
commit 5610926d0a

View file

@ -17,7 +17,7 @@
:global LogForwardRateLimit;
:global NotificationsWithSymbols;
:global CharacterReplace;
:global EscapeForRegEx;
:global IfThenElse;
:global LogPrintExit2;
:global QuotedPrintable;
@ -45,9 +45,9 @@ $WaitFullyConnected;
:local MessageVal;
:local MessageDups [ :toarray "" ];
:local LogForwardFilterLogForwarding [ $CharacterReplace ("^Error sending e-mail <" . \
[ $QuotedPrintable ("\\[" . $Identity . "\\] " . [ $SymbolForNotification "warning-sign" ] . \
"Log Forwarding") ] . ">:") ("\?") ("\\\?") ];
:local LogForwardFilterLogForwarding ("^" . [ $EscapeForRegEx ("Error sending e-mail <" . \
[ $QuotedPrintable ("[" . $Identity . "] " . [ $SymbolForNotification "warning-sign" ] . \
"Log Forwarding") ] . ">:") ]);
:foreach Message in=[ / log find where !(topics~$LogForwardFilter) !(message="") \
!(message~$LogForwardFilterLogForwarding) !(message~$LogForwardFilterMessage) ] do={
:set MessageVal [ / log get $Message ];