Community discussions

MikroTik App
 
dssmiktik
Forum Veteran
Forum Veteran
Topic Author
Posts: 732
Joined: Fri Aug 17, 2007 8:42 am

Log Parser - Event Trigger Script

Thu Apr 22, 2010 10:00 am

I've written a script to parse a log buffer, and trigger some action based on the log entries read.

This will allow you to monitor for events on RouterOS itself, and run any specified actions.
You can parse an entry to find IP address, host-name, user name, etc... basically anything the log data contains can be evaluated. It also runs very fast as it uses 'print as-value' to capture log entries into memory.

It can be found on the Wiki here: http://wiki.mikrotik.com/wiki/Log_Parse ... ger_Script

If you have a great parser to extract data from a log, please post it, as it may be useful to others and myself.
 
User avatar
janisk
MikroTik Support
MikroTik Support
Posts: 6263
Joined: Tue Feb 14, 2006 9:46 am
Location: Riga, Latvia

Re: Log Parser - Event Trigger Script

Thu Apr 22, 2010 4:08 pm

also, it would be nice if that would work with remote logging, as result you had to build more powerful event driven system. On linux host you have tools like expect/tcl more powerful log parsing capabilities.
 
dssmiktik
Forum Veteran
Forum Veteran
Topic Author
Posts: 732
Joined: Fri Aug 17, 2007 8:42 am

Re: Log Parser - Event Trigger Script

Thu Apr 22, 2010 6:00 pm

also, it would be nice if that would work with remote logging, as result you had to build more powerful event driven system. On linux host you have tools like expect/tcl more powerful log parsing capabilities.
I agree, using Linux to monitor logs is a lot more powerful. There are times though, when I need the router to "monitor itself" in situations, and do some actions.
 
FredFredburger
just joined
Posts: 5
Joined: Mon Mar 12, 2018 6:41 pm

Re: Log Parser - Event Trigger Script

Tue Aug 29, 2023 5:10 pm

Link to wiki page is broken, the last version of the wiki page was archived here: https://web.archive.org/web/20210416175 ... ger_Script
 
msatter
Forum Guru
Forum Guru
Posts: 2942
Joined: Tue Feb 18, 2014 12:56 am
Location: Netherlands / Nīderlande

Re: Log Parser - Event Trigger Script

Wed Aug 30, 2023 1:16 am

Thank for digging up this gem.
 
User avatar
Amm0
Forum Guru
Forum Guru
Posts: 4441
Joined: Sun May 01, 2016 7:12 pm
Location: California
Contact:

Re: Log Parser - Event Trigger Script

Wed Aug 30, 2023 1:32 am

That is pretty clean. Even a two-tone [:beep] – too bad most modern hardware doesn't have a buzzer.

Likely only broken after 13 years with the recent ISO date changes ;).