From de61c14c6087cc181b057843649147e76b2304eb Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Wed, 9 Jun 2021 14:32:52 +0200 Subject: log-forward: implement reverse logic to include messages... ... even if a filter matches to exclude them. Let's have an example: :global LogForwardFilter "(debug|info)"; :global LogForwardInclude "account"; This will forward everything about topic *account* (login, logout, failed login, ...) - even with topic *info*. --- log-forward | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'log-forward') diff --git a/log-forward b/log-forward index 8f72893..2e66089 100644 --- a/log-forward +++ b/log-forward @@ -13,6 +13,8 @@ :global Identity; :global LogForwardFilter; :global LogForwardFilterMessage; +:global LogForwardInclude; +:global LogForwardIncludeMessage; :global LogForwardLast; :global LogForwardRateLimit; :global NotificationsWithSymbols; @@ -48,8 +50,9 @@ $WaitFullyConnected; :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={ +:foreach Message in=[ / log find where (!(message="") and !(message~$LogForwardFilterLogForwarding) and \ + !(topics~$LogForwardFilter) and !(message~$LogForwardFilterMessage)) or \ + topics~$LogForwardInclude or message~$LogForwardIncludeMessage ] do={ :set MessageVal [ / log get $Message ]; :if ($LogForwardLast = ($MessageVal->".id")) do={ -- cgit v1.2.3-54-g00ecf