我正在尝试在 ElastAlert 中设置一个警报,如果星期一 01:00 - 02:00 的事件数量比前一周星期一的同一时间段大或小 10%,它将发出警报。
我们的数据每天都存在很大差异,例如周日与周一相比,每小时也不同。
有没有办法使用尖峰类型或任何其他过滤器来进行这种检查?
我正在尝试在 ElastAlert 中设置一个警报,如果星期一 01:00 - 02:00 的事件数量比前一周星期一的同一时间段大或小 10%,它将发出警报。
我们的数据每天都存在很大差异,例如周日与周一相比,每小时也不同。
有没有办法使用尖峰类型或任何其他过滤器来进行这种检查?
我有同样的问题。我最终得到了 elastAlert 的分支并添加了新的规则类型。
在后台,它会进行另一个 ES 调用并比较数据。它有点脏,不适合原来的 elastAlert 架构。但它确实做到了。它是“spike”和“metric_aggregation”规则的混合体。
https://github.com/spodgurskiy/elastalert
这是我的规则配置示例。
# Alert when there is a sudden spike comparing to the historical data
name: Spike detection
type: metric_history_aggregation
index: metrics-*
# Reference window diff in minutes
date_diff_ref: 10080
# Spike detection
threshold_total: 50
threshold_cur: 0
threshold_ref: 0
spike_height: 1.05
spike_type: both # <both/up/down>
# Aggregation
metric_agg_key: "<field_name>"
metric_agg_type: sum
max_threshold:
# Alert section
alert:
- "slack"
alert_display_timezone: US/Pacific
alert_text_type: exclude_fields
alert_subject: ""
slack_webhook_url: "https://hooks.slack.com/services/..."