【发布时间】:2017-10-19 22:52:54
【问题描述】:
使用 ElastAlert 框架创建 flatline 警报类型。
当我在 Kibana UI 中以完全相同的语法使用查询时,它会返回结果,但 ElastAlert 没有返回任何结果。
这是我的 elastalert-rule-file.xml
name: Test Flatline
type: flatline
run_every:
seconds: 15
relalert:
minutes: 0
es_host: localhost
es_port: 9200
threshold: 1
timeframe:
minutes: 5
index: my-index-*
filter:
- query:
query_string:
query: "_type:metric" # this returns results in both kibana and elastalert
#query: "_type:metric AND _exists_:My\ Field\ With\ Spaces.value" # this returns results in kibana but not in elastalert
timestamp_type: unix_ms
alert:
- command
command: ["my-bash-script.sh"]
所以我尝试使用查询,如果我只指定_type:metric,那么 Kibana 中的搜索结果似乎与 ElastAlert 中的搜索结果相匹配。
但是,当我尝试在第二个查询中使用带有 _exists_ lucene 语法的查询时,ElastAlert 没有返回任何内容,而 Kibana 似乎可以使用该语法。
有什么想法吗?
【问题讨论】:
标签: lucene kibana elastalert