Yelp / elastalert

Easy & Flexible Alerting With ElasticSearch
https://elastalert.readthedocs.org
Apache License 2.0
8k stars 1.73k forks source link

timeframe setting is not work when rule run every minutes #3275

Open wangcrazy1 opened 1 year ago

wangcrazy1 commented 1 year ago

https://help.logit.io/en/articles/3772556-configure-flatline-alerts-for-elasticsearch

Rule name, must be unique

name: send log issue fence to cloudwise type: flatline

threshold: 10000

if the frequency of events drops below threshold in timeframe minutes, an alert is triggered

timeframe: minutes: 6

A list of elasticsearch filters used for find events

These filters are joined with AND and nested in a filtered query

For more info: http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl.html

filter:

use_count_query: true doc_type: _doc

index: tesla* realert: minutes: 1

query_key:

include:

- log.file.path

include:

(Required)

The alert is use when a match is found

alert: post

alert: "elastalert_modules.my_alerts.HTTPPostEpochAlerter" http_post_url: "http://10.195.129.232:50003/xxx_nolog" http_post_static_payload: check: "tesla receive log from fence" hostname: "CN000VM5080" logpath: "C:\SEEBURGER\PROD_BSP_CS\log\Fence_PROD_BSP_FENCE02\Fence_PROD_BSP_FENCE02.lgw" http_post_payload: matches: num_hits timestamp: "@timestamp"

It send the num_hits only contians one minute when rule run every minutes. I think the num_hits should be sum of six minutes hits.