{ "trigger": { "schedule": { "cron": "0 21 * * " } }, "input": { "search": { "request": { "search_type": "query_then_fetch", "indices": [ "" ], "rest_total_hits_as_int": true, "body": { "size": 0, "query": { "bool": { "must": [ { "match_phrase": { "kubernetes.namespace": "tspeu-prd-*" } }, { "match_phrase": { "kubernetes.container.name": "ecarx-vehicle-status-oldplatform" } } ], "filter": [ { "match_phrase": { "message": "接收Kafka消息" } }, { "range": { "@timestamp": { "from": "now-15h", "to": "now-3h" } } } ] } } } } } }, "condition": { "compare": { "ctx.payload.hits.total": { "gt": 0 } } }, "actions": { "my_webhook": { "throttle_period_in_millis": 5000, "webhook": { "scheme": "https", "host": "qyapi.weixin.qq.com", "port": 443, "method": "post", "path": "/cgi-bin/webhook/send", "params": { "key": "bbf9c09c-24da-4a0f-b6f8-940a896e1b7d" }, "headers": { "Content-Type": "application/json" }, "body": """{ "msgtype": "text", "text": { "content": "每天6点到21点每小时kafka接收数统计 服务: {{ctx.watch_id}} 数量: {{ctx.payload.hits.total}} 时间: {{ctx.trigger.scheduled_time}}" }""" } } } }

trigger schedule cron 0 6-21 input search request search_type query_then_fetch indices rest_total_hits_

原文地址: http://www.cveoy.top/t/topic/M2y 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录