每天6点到21点每小时kafka接收数统计 - ecarx-vehicle-status-oldplatform服务监控
{ "trigger": { "schedule": { "daily": { "at": [ "6:00", "7:00", "8:00", "9:00", "10:00", "11:00", "noon", "13:00", "14:00", "15:00", "16:00", "17:00", "18:00", "19:00", "20:00", "21:00" ] } } }, "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 }, "ctx.trigger.scheduled_time.hour": { "eq": 21 } } }, "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": """{\n "msgtype": "text", "text": { "content": "每天6点到21点每小时kafka接收数统计\n 服务: {{ctx.watch_id}}\n 数量: {{ctx.payload.hits.total}}\n 时间: {{ctx.trigger.scheduled_time}}"} }"" } } } }
原文地址: https://www.cveoy.top/t/topic/mj58 著作权归作者所有。请勿转载和采集!