HOWTO access memory-logs from script ?

I want to process the memory-logs in a script. Any idea how to get the data ?

http://wiki.mikrotik.com/wiki/Scripting-examples#Detect_new_log_entry