json配置
{
"trigger": {
"schedule": {
"interval": "1m"
}
},
"input": {
"search": {
"request": {
"search_type": "query_then_fetch",
"indices": [
"*"
],
"rest_total_hits_as_int": true,
"body": {
"size": 0,
"query": {
"match_all": {}
}
}
}
}
},
"condition": {
"compare": {
"ctx.payload.hits.total": {
"gte": 10
}
}
},
"actions": {
"my-webhook": {
"webhook": {
"scheme": "https",
"host": "oapi.dingtalk.com",
"port": 443,
"method": "post",
"path": "/robot/send",
"params": {
"access_token": "替换成真实的token"
},
"headers": {
"Content-Type": "application/json"
},
"body": "{\"msgtype\": \"text\",\"text\": {\"content\": \"监控告警我就是我, 是不一样的烟火\"}}"
}
}
}
}
xpack收费功能,需要黄金会员,详见:https://www.elastic.co/cn/subscriptions