Dynamic body condition under Watcher

I have a cluster with 3 nodes.
Ip is master
IP and IP are data nodes.

when i gave a condition in as follows

"trigger" : {
"schedule" : { "interval" : "10s" }
"input" : {
"http" : {
"request" : {
"host" : "localhost",
"port" : 9200,
"path" : "/_cluster/health",
"auth" : {
"basic" : {
"username" : "123",
"password" : "123"
"condition" : {
"compare" : {
"ctx.payload.status" : { "eq" : "yellow" }
"actions" : {
"send_email" : {
"email" : {
"to" : "abc@xxx.com",
"subject" : "ES Cluster Status Warning",
"body" : "The Cluster with ip is down."

Same condition is replicated with other two nodes. So if ip is failed then im getting an alert as The Cluster with ip is down. How can i give a condition in condition under body so that if node fails it should alert me as The Cluster with ip is down and vice versa.

Note:- One condition under master node is replicated to other two nodes with same condition.


I do not really understand your requirement, but let me try to fill some of the empty voids here.

When you poll localhost, you are always polling the current master node where watcher is running currently. If you master node changes in your three node cluster, you cannot guarantee that the host with ip is down. If you master node never changes, you will never get to know other node failures. Please take your time and read about topology of elasticsearch cluster in the the definitive guide in order to understand how all of this works. This should also make your requirement somewhat more clear and also give you the basics of Elasticsearch as a distributed system. You will also understand while having a single master node and two data nodes does not make a lot of sense.


How can i give this condition dynamically. IP should be dynamic. If data node fails also its sending alert as master's IP is down. I need a dynamic condition in body.

And i changed it from localhost to the respective IP

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