# WebSite up down status

**URL:** https://discuss.elastic.co/t/website-up-down-status/104758
**Category:** Elasticsearch
**Tags:** elastic-stack-alerting
**Created:** [October 21, 2017, 2:53am UTC](https://discuss.elastic.co/t/website-up-down-status/104758 "2017-10-21T02:53:09Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![RSundareswaran](https://avatars.discourse-cdn.com/v4/letter/r/9fc348/32.png) [@RSundareswaran](https://discuss.elastic.co/u/RSundareswaran)
#### Post date: [October 21, 2017, 2:53am UTC](https://discuss.elastic.co/t/website-up-down-status/104758/1 "2017-10-21T02:53:09Z")

</div>

Hi,

We tried using heartbeat in polling some webservices endpoint and successful in ingesting the data to ELK. Also we got alerts when any WS goes down. We wanted to get one more alert when the WS is back and running. Any solution appreciated.

Regards,  
Raj

---

<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: [October 21, 2017, 6:52am UTC](https://discuss.elastic.co/t/website-up-down-status/104758/2 "2017-10-21T06:52:50Z")

</div>

you need to have a watch that queries the previous watch history to gather information from the last status. Using this technique it might also be easier having one watch for each state, but that depends on the watch.

We are planning to be able to access some data of previous executions in the context, but we are not there yet.

---

<div class="post-metadata">

### Author: ![RSundareswaran](https://avatars.discourse-cdn.com/v4/letter/r/9fc348/32.png) [@RSundareswaran](https://discuss.elastic.co/u/RSundareswaran)
#### Post date: [November 8, 2017, 10:53pm UTC](https://discuss.elastic.co/t/website-up-down-status/104758/3 "2017-11-08T22:53:54Z")

</div>

Thanks for the suggestion. I tried but I'm stuck at a point where I couldn't compare against previous history. Can you explain a bit more?

The solution I have is

1. Created a new index with two types as 'current' and 'previous' with same id as 'endpoint1'.
2. Created two watchers with each one updating the 'current' as true/false from the heartbeats up status.
3. Set the 'previous' as true initially.
4. Trying to compare the 'previous' and 'current' but couldn't proceed further. This is where some suggestions would be appreciated.

---

<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: [November 9, 2017, 1:42pm UTC](https://discuss.elastic.co/t/website-up-down-status/104758/4 "2017-11-09T13:42:12Z")

</div>

Hey,

I am not sure why you need two watches here. Let me lay out my idea (which of course may have flaws).

1. Create a watch with a chained input. First one getting the document that stores the state of the execution (either a get or a search by \_uid), second input is doing your actually search work.
2. condition might be not needed at all
3. define two actions. First one is triggering your regular alert, second one is writing back into the state document with the current value. Every action can have its own condition, so you can only trigger the alert if a certain condition is met, but you could always write the state if needed.

Hope this helps a bit!

--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: [December 7, 2017, 1:42pm UTC](https://discuss.elastic.co/t/website-up-down-status/104758/5 "2017-12-07T13:42:31Z")

</div>

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