Uploaded image for project: 'ZABBIX FEATURE REQUESTS'
  1. ZABBIX FEATURE REQUESTS
  2. ZBXNEXT-7431

provide a macro or any other means to insert current year (or date) in logitem

XMLWordPrintable

    • Icon: Change Request Change Request
    • Resolution: Duplicate
    • Icon: Trivial Trivial
    • None
    • 5.0.19
    • Agent (G)
    • None

      One of my application logs only month, day and time. Year info is missing. I want to use the log time format to get the local time in latest data. For now I hardcoded the current year "2022" in the template and I hope II won't forget about this again next januari. A much more convenient solution would be to be able to specify a macro that inserts this data.
      Since the logitem is created with skip, I think it is safe to assume that the agents systemtime is OK.

      example:
      log[

      {#FILE},"([0-9]+ [0-9a-z]+ )([0-9]).([0-9] [0-9]:[0-9]:[0-9]+)( ### )(.error_code=.|.Number of Archive files processed.|.SBTOBJECT_FILETYPE.|.auto backup.)",,20,skip,"2022\2\3 \1 \5"]

      change to:

      log[{#FILE}

      ,"([0-9]+ [0-9a-z]+ )([0-9]).([0-9] [0-9]:[0-9]:[0-9]+)( ### )(.error_code=.|.Number of Archive files processed.|.SBTOBJECT_FILETYPE.|.auto backup.)",,20,skip,"{$YYYY}\2\3 \1 \5"]

      assuming that a macro {$YYYY} exists to fill the missing data.

      It's not a major issue, more a nice to have. Still very welcome. Maybe the other regular data fields can be added to as macros?

            vso Vladislavs Sokurenko
            ik_zelf Ronald Rood
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: