Ad Widget

Collapse

Trigger configuration for log file counts

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Micha2222
    Junior Member
    • Aug 2022
    • 9

    #1

    Trigger configuration for log file counts

    Hello Zabbix community. I am searching for a configuration of the following scenario:
    I am searching logs for keywords and want to fire the trigger if the keyword was found for example 10 times in a timerange of 5 minutes.
    All my configuration failed in past, thank you for support.
    Last edited by Micha2222; 01-09-2022, 12:56.
  • Micha2222
    Junior Member
    • Aug 2022
    • 9

    #2
    I thought it was easy but since noone replies it might be not even possible :-D

    Comment

    • dimir
      Zabbix developer
      • Apr 2011
      • 1080

      #3
      The suspicious part here is “logs”. If that’s a single log file, that’s single item and that’s easy, otherwise it’s hard to imagine what exactly is the task here.

      Comment

      • Micha2222
        Junior Member
        • Aug 2022
        • 9

        #4
        Thanks for your reply, Dimir. Easy sounds pretty awesome. I am checking bind9 querylog for any resquests. The trigger fires at any ANY request so I would like it set up that it will fire when it is found 10 times in the past 5 minutes. The log is checked every second with skip command.
        Last edited by Micha2222; 01-09-2022, 21:02. Reason: Text disappeared

        Comment

        • dimir
          Zabbix developer
          • Apr 2011
          • 1080

          #5
          Looks like you could use trigger function count() in your trigger expression:
          Code:
          count(/host/key,5m,"like","error")>9
          Which translates to: fire a trigger if the item with key key on the host host will contain more than 9 values that match the word "error" in the last 5 minutes.
          Last edited by dimir; 01-09-2022, 21:49.

          Comment

          • Micha2222
            Junior Member
            • Aug 2022
            • 9

            #6
            Man thank you so much, this works! :-)

            Comment

            Working...