mirror of
https://git.eworm.de/cgit/routeros-scripts
synced 2025-07-24 12:54:28 +02:00
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*.
This commit is contained in:
parent
d5f43aa26d
commit
de61c14c60
6 changed files with 20 additions and 7 deletions
|
@ -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={
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue