新增监控
配置页面
配置参数
{
"trigger": {
"schedule": {
"cron": "0/30 0/1 1-6 ? * MON-FRI"
}
},
"input": {
"search": {
"request": {
"search_type": "query_then_fetch",
"indices": [
"pos-management-prod-*"
],
"rest_total_hits_as_int": true,
"body": {
"size": 0,
"query": {
"bool": {
"must": [
{
"match": {
"level": "INFO"
}
},
{
"terms": {
"tags": [
"position,position-hub-conductor"
]
}
},
{
"range": {
"@timestamp": {
"gte": "now-30s"
}
}
}
],
"must_not": []
}
}
}
}
}
},
"condition": {
"compare": {
"ctx.payload.hits.total": {
"lte": 0
}
}
},
"actions": {
"my-webhook-action": {
"webhook": {
"scheme": "http",
"host": "172.17.48.55",
"port": 80,
"method": "post",
"path": "pos-alerts",
"params": {},
"headers": {},
"body": """
{
"msgtype": "markdown",
"markdown":{
"title": "OMK-Alerts",
"text": "# **【仓位核对】-心跳异常 {{ ctx.payload.hits.total }}**\n### 关注: @15618902613@15000396536"
},
"at": {
"atMobiles": ["15618902613","15000396536"]
}
}
"""
}
}
}
}