How can one parse a log file's timestamp with a variable prefix?
The Zabbix proxy log file on Unix like systems for example has a PID information in front of the timestamp:
Because a PID is not fixed in length the log time format from the documentation:
"pppppp:yyyyMMdd:hhmmss”
will only match log entries with a PID of 6 digits.
Edit:
Just noticed that lower PIDs get filled up with spaces by Zabbix to achieve a fixed length. But same question if that would not happen.
The Zabbix proxy log file on Unix like systems for example has a PID information in front of the timestamp:
Code:
28359:20121016:140029.159 [Z3005] query failed: [0] columns hostid, name are not unique [insert into applications (applicationid,hostid) values (4180,10353);
"pppppp:yyyyMMdd:hhmmss”
will only match log entries with a PID of 6 digits.
Edit:
Just noticed that lower PIDs get filled up with spaces by Zabbix to achieve a fixed length. But same question if that would not happen.