Ad Widget

Collapse

Logging with different filenames / Timestamp in filename of log

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • FFB-Group
    Junior Member
    • Jan 2023
    • 14

    #1

    Logging with different filenames / Timestamp in filename of log

    Hey guys,
    so i want to monitor logs from our own applications. The filename contains a timestamp. What is the best way to solve that? I only found solutions where the filename is always the same.
    I thought about a script which checks for the newest filename but i don't really now how to implement scripts in zabbix.

    Here a screenshot of my tests so far, both of them work like this:
    Click image for larger version

Name:	image.png
Views:	461
Size:	13.7 KB
ID:	466619
    Sadly wildcards won't work in zabbix...
    Would really appreciate some help.
  • Hamardaban
    Senior Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • May 2019
    • 2713

    #2
    Try logrt item key

    logrt[file regexp,<regexp>,<encoding>,<maxlines>,<mode>,<outp ut>,<maxdelay>,<options>,<persistent dir>]


    Parameters:
    • file regexp - the absolute path to file and the file name described by a regular expression. Note that only the file name is a regular expression.

    Comment

    • FFB-Group
      Junior Member
      • Jan 2023
      • 14

      #3
      Thanks, that worked for me.

      Comment

      • FFB-Group
        Junior Member
        • Jan 2023
        • 14

        #4
        Do you also have an idea how to do a trigger for the item?

        I tried it like this but it wont work
        Click image for larger version

Name:	image.png
Views:	449
Size:	10.8 KB
ID:	466641

        I want to create a trigger which creates a error message each time it finds a new [ERR] entry in the log file.
        Thank you

        (As u can see i get data from the host)
        Click image for larger version

Name:	image.png
Views:	438
Size:	6.6 KB
ID:	466642

        Comment

        • Hamardaban
          Senior Member
          Zabbix Certified SpecialistZabbix Certified Professional
          • May 2019
          • 2713

          #5
          Does your data contain the substring ERR?
          I understand that based on the expression for logrt should - but how really?
          And of course you know that the trigger will not work according to the old data? only at the moment of the arrival of a new value?

          Comment

          Working...