使用netstat -lntp来看看有侦听在网络某端口的进程。当然,也可以使用 lsof。

watcher webhook报警,如何实现body内得到相应字段值

Elasticsearch | 作者 yoling1985 | 发布于2019年11月07日 | 阅读数:1992

请教下watcher webhook报警问题,我想在body内得到相应字段值如何取得?利用{{_source.src_ip}}这种方式sentinel可以用,watcher下怎么取得

  "actions": {
    "my-logging-action": {
      "webhook": {
        "scheme": "http",
        "host": " 10.0.0.55",
        "port": 8080,
        "method": "post",
        "path": "/{{watch_id}}",
        "params": {},
        "headers": {
          "Content-Type": "application/json"
        },
        "body": "{\r\n    \"msgtype\": \"markdown\",\r\n    \"at\": {\r\n        \"isAtAll\": \"True\"\r\n    },\r\n    \"markdown\": {\r\n        \"title\": \"异常消息\",\r\n        \"text\": \" 发现网络攻击: \\n {{#ctx.payload.hits.total}} \r\n 攻击源IP为:{{_source.src_ip}},防护动作: \r\n {{_source.action}}, \r\n 攻击地区:{{_source.geoip.country_name}}, \r\n 攻击次数:{{_source.attack_cout}}, \r\n{{/ctx.payload.hits.total}}\"\r\n    }\r\n}"
      }
    }
  }
 
已邀请:

xm110224 - 运维人员

赞同来自:

有获取到吗?

要回复问题请先登录注册