Unexpected token [START_ARRAY] when updating watch with Slack action

Elasticsearch 2.2.1

I am trying to update a watch, adding a "to" field to a slack action, using this as example.

This works :

  "actions": {
    "notify-slack": {
      "slack": {
        "message": {
          "text": "Encountered  {{ctx.payload.hits.total}} errors in the last 5 minutes"
        }
      }
    }
  }

But when I try to add the "to" field :

  "actions": {
    "notify-slack": {
      "slack": {
        "to" : [ "@bpoirson"],
        "message": {
          "text": "Encountered  {{ctx.payload.hits.total}} errors in the last 5 minutes"
        }
      }
    }
  }

Elasticsearch returns me this :

{
  "error": {
    "root_cause": [
      {
        "type": "parse_exception",
        "reason": "failed to parse [slack] action [log_error_watch_test/notify-slack]. unexpected token [START_ARRAY]"
      }
    ],
    "type": "parse_exception",
    "reason": "failed to parse [slack] action [log_error_watch_test/notify-slack]. unexpected token [START_ARRAY]"
  },
  "status": 400
}

Any idea on what I'm doing wrong here?

Thanks

So I realized that the first snippet is wrong and the correct structure is :

  "actions": {
    "notify-slack": {
      "slack": {           
        "message": {
          "to" : [ "@bpoirson"],
          "text": "Encountered  {{ctx.payload.hits.total}} errors in the last 5 minutes"
        }
      }
    }
  }

Hey

thanks for the update, I just fixed the documentation, which should be updated over the day!

--Alex

Thanks.

On the same subject, the configuration option for the proxy is also missing:

watcher:
  http:
    proxy:
      host: proxy.adress
      post: 8080

It is only present in the release notes, which makes it harder to find.