flatline
使用 ElastAlert 框架创建警报类型。
当我在 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 似乎可以使用该语法。
有任何想法吗?