Hello everyone,
I need to set up a watcher in Kibana with the following conditions:
a. Trigger an alert when the threshold reaches 100 between 6 AM and 11 AM. b. Trigger an alert when the threshold reaches 400 during other times.
Note: This should be done in a single watcher.
Here is the condition script:
"condition": {
"script": {
"source": "if (ctx.payload.hits.total <= 100 && (ctx.trigger.triggered_time.getHour() >= 6 && ctx.trigger.triggered_time.getHour() <= 11)) { return true; } else if (ctx.payload.hits.total <= 400) { return true; } else { return false; }",
"lang": "painless"
}
}