Hi,
I am new to Kibana Watchers and I am facing issues in parsing the desired value to "ctx.payload.aggregations".
I get the below result
"ctx.payload.aggregations.numberofcmtsId.buckets.count_deriv.value": null
My Watcher Query is as below
{
"trigger" : {
"schedule" : { "interval" : "60s" }
},
"input" : {
"search" : {
"request" : {
"indices" : [ "snmp-*" ],
"body" : {
"size":0,
"query": {
"range": {
"timestamp": {
"gte": "now-90m/m",
"lte": "now-30m/m"
}
}
},
"aggs": {
"every30min": {
"date_histogram": {
"field": "timestamp",
"fixed_interval": "30m",
"order": {
"_key": "desc"
}
},
"aggs": {
"numberofcmtsId": {
"cardinality": {
"field": "cmtsId"
}
},
"count_deriv": {
"derivative": {
"buckets_path": "numberofcmtsId"
}
}
}
}
}
}
}
}
},
"condition" : {
"compare": {
"ctx.payload.aggregations.numberofcmtsId.buckets.count_deriv.value" : { "gt" : 10 }
}
},
"actions" : {
"send_email" : {
"throttle_period" : "5m",
"email" : {
"to" : "abc@xyz.com",
"subject" : "TEST: CMTS Count Watcher Notification",
"body" : ""
}
}
}
}
Can anyone please help on what I am doing wrong in "ctx.payload.aggregations" ?