Hi,
Currently I am working on a watcher in Kibana 7.x. In here I need to compare a field (which is a float value) and perform an action. I am using a advanced watch for this requirement. Here I extract the field that I want and then compare it against a value. But the action is not triggered. Following is the JSON file of the watcher.
{
"trigger": {
"schedule": {
"interval": "1m"
}
},
"input": {
"search": {
"request": {
"indices": [
"abc-*"
]
},
"extract" : ["amount"]
}
},
"condition": {
"compare": {
"ctx.payload": {
"gt": 10
}
}
},
"actions": {
"my-logging-action": {
"logging": {
"text": "There are {{ctx.payload.hits.total}} documents in your index. amount is above 10."
}
}
}
}
It is my pleasure if any one can correct my error.
Thanks.