Creating watch with webhook without params fails

I'm trying to create a watcher with a webhook action. I'm using the following:

{
  ...
  "actions": {
    "some-webhook": {
      "webhook": {
        "scheme": "http",
        "host": "some_host",
        "port": some_port,
        "method": "post",
        "path": "/some/path",
        "headers": {
          "Cache-Control": "no-cache",
          "Content-Type": "application/json"
        },
        "body": "some JSON data"
      }
    }
  }
}

When saving this, Elasticsearch will add an empty "params" key, like this:

{
  ...
  "actions": {
    "some-webhook": {
      "webhook": {
        "scheme": "http",
        "host": "some_host",
        "port": some_port,
        "method": "post",
        "params": {},          <-- this is added by ES
        "path": "/some/path",
        "headers": {
          "Cache-Control": "no-cache",
          "Content-Type": "application/json"
        },
        "body": "some JSON data"
      }
    }
  }
}

The problem is that the webhook then tries to access the URL http://some_host:some_port/some/path?, with a question mark, as if URL parameters would follow. This makes my web server respond with a 404 error.

(Just to be clear, the goal is to POST some data to the URL http://some_host:some_port/some/path - without the question mark).

Is this a bug, or am I doing something wrong? I'm using version 6.1.1.

This is a bug on the watcher side and is fixed in 6.2.4.

Thanks! Do you have a link to the issue on GitHub?

Unfortunately not, because the code of x-pack is not yet open. From 6.3.0 onwards we will have this though!

Oh, right, I forgot that. Many thanks, Alexander!

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.