Hello
Being fairly new to both regex and zabbix, i've run into trouble with the zabbix log file item.
I have a regex which finds a line where my program starts and also returns the previous line.
Its used to monitor if the program was shut down properly before being started again.
I've verified that the regex (global) finds both lines that i am looking for on regexr.com
e.g. in the sample log data below:
and
However I can't get zabbix RegEx test (under admin/regex) to work.
Neither (of course) the actual log item in zabbix, posted below for reference.
Type: Zabbix agent active
Key:
Type of info: Log
If there is a kind soul out there that would lend me some assistance I'd be most grateful.
My RegEx:
Sample log data:
Online example:
https://regexr.com/42alr
Edit #1 - I'm using zabbix 4.0
Edit #2 - Replaced example data with real life data after Chew.Young correctly pointed that out.
Edit #3 - Updated regexr example with new name
Cheers Kurt
Being fairly new to both regex and zabbix, i've run into trouble with the zabbix log file item.
I have a regex which finds a line where my program starts and also returns the previous line.
Its used to monitor if the program was shut down properly before being started again.
I've verified that the regex (global) finds both lines that i am looking for on regexr.com
e.g. in the sample log data below:
Code:
01/10-18 00:10:23:885 TankMeasureCom v4.9.1 shut down... 01/10-18 00:13:19:622 TankMeasureCom v4.9.1 started...
Code:
01/10-18 00:14:12:639 blabladdd 01/10-18 00:14:13:639 TankMeasureCom v4.9.1 started...
However I can't get zabbix RegEx test (under admin/regex) to work.
Neither (of course) the actual log item in zabbix, posted below for reference.
Type: Zabbix agent active
Key:
Code:
log[c:\progra~1\ok3\drift\logfiles\TankMeasureComLog.txt,"(.*)\n.*TankMeasureCom.v[0-9].[0-9].[0-9].started.*",,,,\1,]
If there is a kind soul out there that would lend me some assistance I'd be most grateful.
My RegEx:
Code:
(.*)\n.*TankMeasureCom.v[0-9].[0-9].[0-9].started.*
Code:
01/10-18 00:09:34:760 blablalba 01/10-18 00:10:22:745 blablalba 01/10-18 00:10:23:885 TankMeasureCom v4.9.1 shut down... 01/10-18 00:13:19:622 TankMeasureCom v4.9.1 started... 01/10-18 00:13:19:825 blablalba 01/10-18 00:13:19:841 blablalba 01/10-18 00:13:19:841 blablalba 01/10-18 00:14:12:639 blabladdd 01/10-18 00:14:13:639 TankMeasureCom v4.9.1 started... 01/10-18 00:14:19:936 blabla 01/10-18 00:14:19:951 blabla
https://regexr.com/42alr
Edit #1 - I'm using zabbix 4.0
Edit #2 - Replaced example data with real life data after Chew.Young correctly pointed that out.
Edit #3 - Updated regexr example with new name
Cheers Kurt
Comment