From 1c56809cd4303ab1c38ffddf5d429ec22a57bd1e Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Tue, 10 May 2022 15:08:30 +0200 Subject: [PATCH] log-forward: RouterOS v7 path syntax --- log-forward | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/log-forward b/log-forward index 3cd83d5..1aa0363 100644 --- a/log-forward +++ b/log-forward @@ -52,10 +52,10 @@ $WaitFullyConnected; :local LogForwardFilterLogForwarding ("^" . [ $EscapeForRegEx ("Error sending e-mail <" . \ [ $QuotedPrintable ("[" . $Identity . "] " . [ $SymbolForNotification "warning-sign" ] . \ "Log Forwarding") ] . ">:") ]); -:foreach Message in=[ / log find where (!(message="") and !(message~$LogForwardFilterLogForwarding) and \ +: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 ]; + :set MessageVal [ /log/get $Message ]; :if ($Last < [ $HexToNum ($MessageVal->".id") ]) do={ :local DupCount ($MessageDups->($MessageVal->"message")); @@ -75,7 +75,7 @@ $WaitFullyConnected; subject=([ $SymbolForNotification "warning-sign" ] . "Log Forwarding"); \ message=("The log on " . $Identity . " contains " . [ $IfThenElse ($Count = 1) \ "this message" ("these " . $Count . " messages") ] . " after " . \ - [ / system resource get uptime ] . " uptime." . [ $IfThenElse ($Duplicates = true) \ + [ /system/resource/get uptime ] . " uptime." . [ $IfThenElse ($Duplicates = true) \ (" Multi-repeated messages have been skipped.") ] . "\n" . $Messages) }); :set LogForwardRateLimit ($LogForwardRateLimit + 10);