首页 > 解决方案 > ElastAlert 频率规则没有得到任何命中/查找

问题描述

我无法对频率规则产生任何影响。我从 elastalert 获得样板代码并更新了主机、端口、索引和查询。接下来,我在 elasticsearch 中发布了一些数据,以便在 elastalert 查找后发送电子邮件。但是 elastalert 没有找到这些数据。以下是规则文件和弹性搜索数据。

# Elasticsearch host
es_host: localhost

# (Optional)
# Elasticsearch port
es_port: 9200

# (OptionaL) Connect with SSL to Elasticsearch
#use_ssl: True

# (Optional) basic-auth username and password for Elasticsearch
#es_username: someusername
#es_password: somepassword

# (Required)
# Rule name, must be unique
name: Example frequency rule

# (Required)
# Type of alert.
# the frequency rule type alerts when num_events events occur with timeframe time
type: frequency

# (Required)
# Index to search, wildcard supported
index: test

# (Required, frequency specific)
# Alert when this many documents matching the query occur within a timeframe
num_events: 1

# (Required, frequency specific)
# num_events must occur within this amount of time to trigger an alert
timeframe:
  hours: 1

# (Required)
# 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:
- term:
    name: "aamir"~~

[![Kibana showing required data][2]][2]


  [1]: https://i.stack.imgur.com/dRi2Z.png
  [2]: https://i.stack.imgur.com/uTjUT.png

标签: elasticsearchyamlelastalert

解决方案


推荐阅读