log entry and action when occurs

Dear scripting gurus, I would like to ask you for help.
Please help me with a simple script, which will monitor /log for one exact message - “FCC: Attemtped to send a frame with no bonded connections established” and if this message appears in the log - restart container.
There is no problem with container restart (somethiing like /container stop [find where interface=veth-xxx], :delay, then /container start [find where interface=veth-xxx]), but I can’t understand how to monitor log for this specific entry and then run a desired action.
Thank you in advance.

Something like:
http://forum.mikrotik.com/t/parsing-log-file-to-get-ip/149094/1
might be of inspiration, but I believe the issue is that you must clear the log (setting its lines to 1 and then back to the “normal” number of lines, like in this (old) script):
https://web.archive.org/web/20210416175553/https://wiki.mikrotik.com/wiki/Log_Parser_-_Event_Trigger_Script
every time, and this might be inconvenient/not wanted.

Thanks @jaclaz, reading and trying more and more :grinning_face:

search better on forum, some of my script do not catch twice the same log, only new added log…


http://forum.mikrotik.com/t/how-to-make-mikrotik-beep-on-adding-new-log-entry/173034/3
:global lastLog
:if ([:typeof $lastLog] != “num”) do={:set lastLog 0}

{
:local id2num do={:return [:tonum “0x$[:pick $1 1 [:len $1]]”]}

/log
:foreach item in=[find where (([$id2num $“.id”] > $lastLog) and (message=“FCC: Attemtped to send a frame with no bonded connections established”))] do={
:set lastLog [$id2num $item]
# do something here…
}

}

Thank you, @rextended, works like a charm!