diff options
author | Christian Hesse <mail@eworm.de> | 2021-06-09 14:32:52 +0200 |
---|---|---|
committer | Christian Hesse <mail@eworm.de> | 2021-06-09 14:42:43 +0200 |
commit | de61c14c6087cc181b057843649147e76b2304eb (patch) | |
tree | 50ec29f7e96a457a74985c9fc61b460f8e036496 /log-forward | |
parent | d5f43aa26daa77d4211a3a71c2d8c6f765489891 (diff) |
log-forward: implement reverse logic to include messages...change-55
... 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*.
Diffstat (limited to 'log-forward')
-rw-r--r-- | log-forward | 7 |
1 files changed, 5 insertions, 2 deletions
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={ |