1
0
mirror of https://github.com/eworm-de/routeros-scripts.git synced 2024-05-11 05:55:19 +00:00

log-forward: cache the result of $LogForwardFilterLogForwarding

Looks like the function is called for every message to match otherwise. 😳
This commit is contained in:
Christian Hesse
2023-01-20 11:15:55 +01:00
parent 2294ac77a8
commit 072d349473

View File

@ -47,8 +47,9 @@ $ScriptLock $0;
:local MessageVal;
:local MessageDups ({});
:local LogForwardFilterLogForwardingCached [ $EitherOr [ $LogForwardFilterLogForwarding ] ("\$^") ];
:foreach Message in=[ /log/find where (!(message="") and \
!(message~[ $EitherOr [ $LogForwardFilterLogForwarding ] ("\$^") ]) and \
!(message~$LogForwardFilterLogForwardingCached) and \
!(topics~$LogForwardFilter) and !(message~$LogForwardFilterMessage)) or \
topics~$LogForwardInclude or message~$LogForwardIncludeMessage ] do={
:set MessageVal [ /log/get $Message ];