# Kibana watcher alert error

**URL:** <https://discuss.elastic.co/t/kibana-watcher-alert-error/190601>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-alerting\
**Created:** [July 15, 2019, 7:06pm UTC](https://discuss.elastic.co/t/kibana-watcher-alert-error/190601 "2019-07-15T19:06:09Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![techrichit](https://avatars.discourse-cdn.com/v4/letter/t/df788c/32.png) [@techrichit](https://discuss.elastic.co/u/techrichit)\
**Post date:** [July 15, 2019, 7:06pm UTC](https://discuss.elastic.co/t/kibana-watcher-alert-error/190601/1 "2019-07-15T19:06:09Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [August 1, 2019, 12:07pm UTC](https://discuss.elastic.co/t/kibana-watcher-alert-error/190601/2 "2019-08-01T12:07:14Z")

</div>

Hey,

at the core this is not a watcher question, but we need to have a proper search up and running first. Can you share some sample data and **only** the full search operation (including indices etc) that you are tring to and we'll go from there.

--Alex

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [August 29, 2019, 12:07pm UTC](https://discuss.elastic.co/t/kibana-watcher-alert-error/190601/3 "2019-08-29T12:07:18Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
