Hello
I'm finding hard time to have working query to execute Kibana Watcher. I feel my condition and query is correct but it didn't execute as per the condition. Could you confirm what is wrong in this?
{
"trigger": {
"schedule": {
"interval": "5m"
}
},
"input": {
"search": {
"request": {
"search_type": "query_then_fetch",
"indices": [
"*Index*"
],
"rest_total_hits_as_int": true,
"body": {
"size": 1,
"query": {
"bool": {
"must": [],
"filter": [
{
"bool": {
"filter": [
{
"bool": {
"should": [
{
"match": {
"APPLICATION_NAME": "order"
}
}
],
"minimum_should_match": 1
}
},
{
"bool": {
"filter": [
{
"bool": {
"should": [
{
"match": {
"PARTITION": 3
}
}
],
"minimum_should_match": 1
}
},
{
"bool": {
"should": [
{
"match_phrase": {
"message": "orderXmlReceived"
}
}
],
"minimum_should_match": 1
}
},
{
"range": {
"@timestamp": {
"lte": "now-5m/m"
}
}
}
]
}
}
]
}
}
],
"should": [],
"must_not": []
}
}
}
}
}
},
"condition": {
"compare": {
"ctx.payload.hits.total": {
"eq": 0
}
}
},
"actions": {
"email_administrator": {
"throttle_period_in_millis": 900000,
"email": {
"profile": "standard",
"priority": "high",
"to": [
"myemail@gmail.com"
],
"subject": "Order Partition 0 ",
"body": {
"text": "Please check with support team"
}
}
}
}
}