I am try to create a watcher alert for this I am trying to write a json logic to grep from kibana logs i am unsucessfull.
my requirement: I have three fields a_uniquejobid and b_status and c_timestamp.
from the logs i am trying to achieve : for every a_uniquejobid which has b_status "start" must have b_status "end" in 3 hours.
for each a_uniquejobid in the past 3 hours:
if exists b_status = "start" and not-exists b_status = "end"
then raise alert
Here is how my body look like.
"body": "{"query": {"bool": {"filter": [{"range": {"@c_timestamp": {"gte": "now-3h", "lte": "now"}}}],"must": [ {"match": {"a_uniquejobid": "start"}}],"must": [ {"match":{"b_status": NOT "end"}}]}}}"
this logic is not working for me can anyone help.
Alert part is working for me for basic query.