Press "Enter" to skip to content

ELK x-package watcher webhook配置

我们在配置watcher的时候,有时候期望将事件触发给自己写的服务来进行进一步的处理,这时候就需要写一些webhook了。

这里写个配置的例子。

{
"actions": {
    "test_webhook": {
      "webhook": {
        "scheme": "http",
        "host": "10.255.255.101",
        "port": 3000,
        "method": "post",
        "path": "/",
        "params": {},
        "headers": {
          "Content-Type": "application/json"
        },
        "body": "{\"text\":{{#toJson}}ctx.payload{{/toJson}},\"channel\":\"123123@chatroom\",\"username\":\"{{ctx.metadata.name}}\"}",
        "connection_timeout_in_millis": 5000,
        "read_timeout_millis": 5000
      }
    }
  }
}

参考文档

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注