This is my Watch, for some reason ctx.payload.hits.total returns zero
curl -XPUT 'http://172.17.0.2:9200/_watcher/watch/ehackb_watch19' -d '
{
"trigger": {
"schedule": { "interval" : "15s"}
},
"input" : {
"search" : {
"request" : {
"indices" : ["capi"],
"types" : ["generics"],
"body" : {
"query" : {
"match" : {"data.to.name":"crm@person-get"}
}
}
}
}
},
"condition": {
"compare" : {
"ctx.payload.hits.total" : {
"gt":0
}
}
},
"actions" : {
"send_email" : {
"email" : {
"to" : "lim_le_kamelancien@hotmail.com",
"subject" : "Alert",
"body" : "No data being received"
}
}
}
}'