How to convert any error log to script ?!

Hi guys.
How is it going ?
simple question / If something wrong happened and it has been shown in the LOG ,how can i convert that error log to script for off course to do something e.g.reboot .
I bring this image with errors which I would like to convert them to script.
Anyone have an idea please

.

Look at these posts:
http://forum.mikrotik.com/t/log-monitoring-script/124421/1
http://forum.mikrotik.com/t/log-monitor-script/137574/1
May also be other good posts.

Good idea .thanks