# Checking the ack state of a watch without doing an API call

**URL:** <https://discuss.elastic.co/t/checking-the-ack-state-of-a-watch-without-doing-an-api-call/190310>\
**Category:** Elasticsearch\
**Created:** [July 12, 2019, 9:33pm UTC](https://discuss.elastic.co/t/checking-the-ack-state-of-a-watch-without-doing-an-api-call/190310 "2019-07-12T21:33:09Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![samuelburnett](https://avatars.discourse-cdn.com/v4/letter/s/bbce88/32.png) [@samuelburnett](https://discuss.elastic.co/u/samuelburnett)\
**Post date:** [July 12, 2019, 9:33pm UTC](https://discuss.elastic.co/t/checking-the-ack-state-of-a-watch-without-doing-an-api-call/190310/1 "2019-07-12T21:33:09Z")

</div>

Is there a way to check, within the watch itself, the ack state of an action without doing an API call? And if so, can you manually change that field within the watch without using the API call?

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [July 13, 2019, 6:07am UTC](https://discuss.elastic.co/t/checking-the-ack-state-of-a-watch-without-doing-an-api-call/190310/2 "2019-07-13T06:07:49Z")

</div>

What about using an [http input](https://www.elastic.co/guide/en/elastic-stack-overview/7.2/input-http.html) which calls the http endpoint from the watch itself?

---

<div class="post-metadata">

**Author:** ![samuelburnett](https://avatars.discourse-cdn.com/v4/letter/s/bbce88/32.png) [@samuelburnett](https://discuss.elastic.co/u/samuelburnett)\
**Post date:** [July 15, 2019, 5:37pm UTC](https://discuss.elastic.co/t/checking-the-ack-state-of-a-watch-without-doing-an-api-call/190310/3 "2019-07-15T17:37:15Z")

</div>

Hmm, I'm not sure. Maybe I can tell you my use case and, if you can, let me know the best way to approach it.

I want to monitor whether a service is up or down. Lets say every minute I check that last five minutes of logs from a service. If there are 0 logs I want to notify the admin and then stop the watch from further execution until the service comes back up.

I looked into the Ack Watch API but wanted to find a better solution. If that info is accessible within the watch itself that would be helpful.

And if not this, is there a way to have a statically created variable that I can access/modify in the watch?

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [July 16, 2019, 2:46pm UTC](https://discuss.elastic.co/t/checking-the-ack-state-of-a-watch-without-doing-an-api-call/190310/4 "2019-07-16T14:46:11Z")

</div>

> [@samuelburnett](#):
>
> I looked into the Ack Watch API but wanted to find a better solution.

Why? I mean why this solution does not work for you?

---

<div class="post-metadata">

**Author:** ![samuelburnett](https://avatars.discourse-cdn.com/v4/letter/s/bbce88/32.png) [@samuelburnett](https://discuss.elastic.co/u/samuelburnett)\
**Post date:** [July 17, 2019, 2:31pm UTC](https://discuss.elastic.co/t/checking-the-ack-state-of-a-watch-without-doing-an-api-call/190310/5 "2019-07-17T14:31:46Z")

</div>

Actually, I think this will work. Thank you

---

<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 14, 2019, 2:31pm UTC](https://discuss.elastic.co/t/checking-the-ack-state-of-a-watch-without-doing-an-api-call/190310/6 "2019-08-14T14:31:48Z")

</div>

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