Ad Widget

Collapse

Log time format and variable prefix

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • BDiE8VNy
    Senior Member
    • Apr 2010
    • 680

    #1

    Log time format and variable prefix

    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:
    Code:
    28359:20121016:140029.159 [Z3005] query failed: [0] columns hostid, name are not unique [insert into applications (applicationid,hostid) values (4180,10353);
    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.
    Last edited by BDiE8VNy; 16-10-2012, 18:16.
Working...