Accessing single tag in watcher

Hello All!

I'm setting up a watcher that'll send an email when a query matches, and all of that is working as expected. What I'm attempting to do is access a single value from an array being returned, the first tag.

The following code:


{ 0=Tag1, 1=Tag2 }

I've tried


None of those appear to be the correct syntax.

I appreciate any assistance from anyone more experienced with the language.


the first variant looks good, see this example (and its output, when you run it yourself):

POST _xpack/watcher/watch/_execute
  "watch": {
    "trigger": {
      "schedule": {
        "interval": "10m"
    "input": {
      "simple": {
        "foo": [ "one", "two", "three" ]
    "actions": {
      "my-logging": {
        "logging": {
          "text": "{{}}"
1 Like

This is what I get for making multiple changes to my watcher at once, something else was causing the break. Thanks for the confirmation, much appreciated.

1 Like

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