Ad Widget

Collapse

Count last 60 seconds of occurrences on a log that rotates hourly

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Kilimbi
    Junior Member
    • Nov 2015
    • 2

    #1

    Count last 60 seconds of occurrences on a log that rotates hourly

    I've set up an system.run item that does a "grep -c 'string' kernel.log".
    The kernel.log file rotates hourly and I'd like to have it triggering an alert when the count for 'string' is less than 100 in the last minute.

    Option 1: Set up a trigger which counts only the value difference in the last minute.

    Option 2: Set up a calculated item which counts only the last minute of the log's entries.

    How can I do this? Any delta function maybe?
    Basically my intention is to have an item which counts the value as if the log rotation was every minute.
  • Kilimbi
    Junior Member
    • Nov 2015
    • 2

    #2
    What I wanted to do was solved by simply changing the Store value
    = 'As is' to 'Delta' in the item configuration page. The polling was being executed once each 60 seconds so showing the difference from the last and actual value does that.

    Comment

    Working...