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