Hi, I've been trying to set a watcher/watchers where it monitors the health of certain indices. If the health of those indices goes red, it'll send out an email.
I've been trying to get the watcher to actually run - by just sending an email if the index is green - but it seems to not be reading the correct variable. It'll send the email when I set the condition to either not equal red or green, so the email aspect doesn't seem to be the problem. The status of the node doesn't seem to email either.
PUT _xpack/watcher/watch/cluster_health_watch
{
"trigger" : {
"schedule" : { "interval" : "10s" }
},
"input" : {
"http" : {
"request" : {
"host" : "<host>",
"port" : <port>,
"path" : "/_cluster/health/1g?level=indices"
}
}
},
"condition" : {
"compare" : {
"ctx.payload.indices.1g.status" : { "eq" : "green" }
}
},
"actions" : {
"send_email" : {
"email" : {
"from" : "<email>",
"to" : "<email>",
"subject" : "Watcher Notification",
"body" : "{{ctx.payload.indeces.1g.status}} - test"
}
}
}
}
Is there anything that I'm doing incorrectly with this watcher, or anything that can be configured? I'm using Kibana 5.0 and elastic 5.0 in this cluster.