I want to monitor the logfile of a program that seems to attach a carriage return and a space after each event, resulting in a log format like this:
In zabbix I define an item with a log or logrt key to parse this logfile.
When I set the log time format to "yyyy-MM-dd hh:mm:ss" zabbix only recognises the timestamp of the first line of the log..
When I set it to "pyyyy-MM-dd hh:mm:ss" (p because a leading space seems to be trimmed out, but matters in this case), zabbix recognises everything except the first line.
No problem I though at first.. but then when all logging is read en the actual monitoring starts by adding new lines every minute it read the last line, which contains the space of the previous log-event as a new event in zabbix, hence next read cycle, the space is left out from the first read line, as it was already seen by zabbix during previous cycle.. and the date format is not recognised.
I managed to filter out the blank lines using a regexp in the log/logrt key , but the date format parsing problem remains..
Anybody knows how to solve this problem?
btw, the program which log I try to monitor is DBforBIX.
Code:
yyyy-MM-dd hh:mm:ss,xxx message... yyyy-MM-dd hh:mm:ss,xxx message... yyyy-MM-dd hh:mm:ss,xxx message... ....
When I set the log time format to "yyyy-MM-dd hh:mm:ss" zabbix only recognises the timestamp of the first line of the log..
When I set it to "pyyyy-MM-dd hh:mm:ss" (p because a leading space seems to be trimmed out, but matters in this case), zabbix recognises everything except the first line.
No problem I though at first.. but then when all logging is read en the actual monitoring starts by adding new lines every minute it read the last line, which contains the space of the previous log-event as a new event in zabbix, hence next read cycle, the space is left out from the first read line, as it was already seen by zabbix during previous cycle.. and the date format is not recognised.
I managed to filter out the blank lines using a regexp in the log/logrt key , but the date format parsing problem remains..
Anybody knows how to solve this problem?
btw, the program which log I try to monitor is DBforBIX.
Comment