试试搜索一下吧

elastic 配置x-pack的日志告警,收不到告警信息。。请教

Elasticsearch | 作者 blackhole | 发布于2017年02月21日 | 阅读数:5790

curl -XPUT 'localhost:9200/_xpack/watcher/watch/log_error_watch?pretty' -H 'Content-Type: application/json' --user elastic:changeme -d'
{
"trigger" : { "schedule" : { "interval" : "10s" }},
"input" : {
"search" : {
"request" : {
"indices" : [ "tomcat_7_74" ],
"body" : {
"query" : {
"match" : { "message": "error" }
}
}
}
}
},
"condition" : {
"compare" : { "ctx.payload.hits.total" : { "gt" : 0 }}
},
"actions" : {
"log_error" : {
"logging" : {
"text" : "Found {{ctx.payload.hits.total}} errors in the logs"
}
}
}
}
'
已邀请:

要回复问题请先登录注册