num hits not match logs of top_count_keys #1462
-
this is my elastalert rule below:
when I receive the elastalert from slack, it shows
why does checking the elastalert log show query 77 hits , and checking the ELK log 3:19 ~ 3:20 also shows 77 logs, but the request_url, request_path, and backend_name of top_count_keys all have 97 logs ? thanks all. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
It's uses the matched record's timestamp, timestampX, and counts all rule hits that fall in the following time range: Range Start: timestampX - timeframe (1 minute in your example) So most likely a previous rule run, such as from the 3:18 to 3:19 query, had also found some hits, but not enough to trigger the alert. Then the next rule run found 77 hits, and so the top_count calculation included some hits from the previous minute. |
Beta Was this translation helpful? Give feedback.
It's uses the matched record's timestamp, timestampX, and counts all rule hits that fall in the following time range:
Range Start: timestampX - timeframe (1 minute in your example)
Range Stop: timestampX + 10 minutes (hardcoded, in case there were logs mis timestamped from the future)
So most likely a previous rule run, such as from the 3:18 to 3:19 query, had also found some hits, but not enough to trigger the alert. Then the next rule run found 77 hits, and so the top_count calculation included some hits from the previous minute.