Ad Widget

Collapse

Cannot get timestamp with log time format in SSH check

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • cedric.marcoux
    Junior Member
    • May 2018
    • 10

    #1

    Cannot get timestamp with log time format in SSH check

    Hello,

    i read a file thrue SSH agent using this command:
    Code:
    sudo tail /var/log/synolog/synobackup.log | awk '/\[Network]/{print $0}'
    I'm using the Log time format "yyyy/mm/dd hh:mm:ss"
    I have a preprocessing regex "\d.*" with \0 that transform this line
    Code:
    info    2022/09/05 20:00:04     SYSTEM: [Network][svmirbackup01] Backup task started.
    to this line
    Code:
    2022/09/05 20:00:04     SYSTEM: [Network][svmirbackup01] Backup task started.
    But zabbix definitively not retrieve timestamp from processed line.

    I have try to replace / and blank space with "p", but its doesn't work.

    Any ideas on this?

    Thanks for help
  • dimir
    Zabbix developer
    • Apr 2011
    • 1080

    #2
    Please refer to the documentation https://www.zabbix.com/documentation...-configuration on specifying the placeholders (note the placeholder for month):

    * y: Year (0001-9999)
    * M: Month (01-12)
    * d: Day (01-31)
    * h: Hour (00-23)
    * m: Minute (00-59)
    * s: Second (00-59)

    So in your case it should be yyyy/MM/dd hh:mm:ss

    Comment

    Working...