A lot of users wish to do something, when a rule is hit in the firewall. That is now possible because you can log it. If you can log it then you can create an event trigger for that.
Create a rule and activate logging on the rule and set log-prefix to lets say “IamHit”. The you scan the log for that text in the log message and voila, there you have your event trigger. Think of port knocking and only activate the next rule when the previous knock was correct.
You have to structure you events and that is why I have proposed using the path in ROS. The name for the process .id of the execute, is the event + path so you can match that with the name in schedule. You can log inside the event script and so track when it is used/(re)started/stopped.
And I don’t say in any way that this the solution, but this is something that we can now work with. My original proposal is allowing much more control over what exactly is happening and react precise to that.
ps. I can parse the log-line but that breaks :execute being run in the background and I loose the process .id I will think about parsing the line somehow. You have the trigger and then you can also have a second script being started to retrieve the matching log line. But then, are you retrieving the correct line because an other event could have just happened. That is where time stamping comes in handy.
update: however :execute can write to file
:execute {} file=eventUser.txt
and between {} sits the script. The file contains the text that print sees. I did not test with :log.
A bit tricky to generate the file with log because it is overwritten, but I got some lines from logging in and out:
18:00:48 system,info,account user test logged out from 192.x.x.x. via winbox
18:00:48 system,info,account user test logged out from 192.x.x.x via local
The size of the file indicates (>2) if there something in there.
The rest I leave to others, I have shown the building blocks and how you can see what and how stored in the file.
Have fun