1
使用ElastAlert框架創建一個flatline
警報類型。ElastAlert flatline找不到結果
當我用完全相同的語法在Kibana UI中使用查詢時,它返回結果,但ElastAlert沒有返回任何結果。
這裏是我的elastalert規則-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似乎對語法沒有問題。
任何想法?