"meta" field in watchers


(Chris Weed) #1

So according to the documentation: https://www.elastic.co/guide/en/x-pack/current/watcher-api-put-watch.html there's a "meta" field that "Metadata json that will be copied into the history entries.".

Now this sounds useful, perhaps I can use it to store some meta data about the watcher(alert) I'm creating. In my specific case I want a user friendly name for the watcher (with spaces and fancy characters). Other information such as owner name, organization, ... the list goes on.

However when I do the CURL command to PUT a new watcher in place (or edit one) and include a meta field, I get the following error:

{
  "error" : {
    "root_cause" : [
      {
        "type" : "parse_exception",
        "reason" : "could not parse watch [my-watch]. unexpected field [meta]"
      }
    ],
    "type" : "parse_exception",
    "reason" : "could not parse watch [my-watch]. unexpected field [meta]"
  },
  "status" : 400
}

I've tried @meta and _meta and I get the same type of error.

Is there any way to add meta type data to a watcher(alert)? And what does this meta field do that the documentation speaks of?


(Alexander Reelsen) #2

Hey,

this field is actually called metadata and not meta. Sorry for the inconvenience, I will fix the docs.

--Alex


(Chris Weed) #3

Awesome thanks!


(system) #4

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