# How to create rule when monitor is up in UPTIME?

**URL:** https://discuss.elastic.co/t/how-to-create-rule-when-monitor-is-up-in-uptime/300940
**Category:** Elasticsearch
**Tags:** elastic-stack-alerting
**Created:** [March 29, 2022, 9:33am UTC](https://discuss.elastic.co/t/how-to-create-rule-when-monitor-is-up-in-uptime/300940 "2022-03-29T09:33:57Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![shivendra95](https://avatars.discourse-cdn.com/v4/letter/s/eb9ed0/32.png) [@shivendra95](https://discuss.elastic.co/u/shivendra95)
#### Post date: [March 29, 2022, 9:33am UTC](https://discuss.elastic.co/t/how-to-create-rule-when-monitor-is-up-in-uptime/300940/1 "2022-03-29T09:33:57Z")

</div>

I was exploring the alerting capabilities in ELK, found a way to trigger alerts when any monitor is down in Uptime App.  
I also want to trigger alerts when the downed service has come back up again but I'm not able create any rule for when service is up.  
Can anyone please help?

---

<div class="post-metadata">

### Author: ![Patrick\_Mueller](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/patrick_mueller/32/109425_2.png) [@Patrick\_Mueller](https://discuss.elastic.co/u/Patrick_Mueller)
#### Post date: [March 29, 2022, 12:47pm UTC](https://discuss.elastic.co/t/how-to-create-rule-when-monitor-is-up-in-uptime/300940/2 "2022-03-29T12:47:42Z")

</div>

Actions added to rules are organized by "action group" - most rules only have one action group, and this is used as the default when creating a rule. This is shown in the web page as "Run when".  
For instance, I believe the Uptime monitor status rule uses "Uptime Down Monitor" as it's action group.

All rules also have an action group "Recovered", which can be used for actions to be run when the alert is no longer active. So, you'll want to add an additional action, and then make sure it's in the "Recovered" action group by selecting that in the Run When selector.

Some doc here: [Create and manage rules | Kibana Guide [8.1] | Elastic](https://www.elastic.co/guide/en/kibana/current/create-and-manage-rules.html#defining-rules-actions-details)

One send-ahead: currently the "Recovered" Action group will not sent any of the `context.*` mustache variables, but the mustache variables that don't start with `context.*` will be available.

---

<div class="post-metadata">

### Author: ![shivendra95](https://avatars.discourse-cdn.com/v4/letter/s/eb9ed0/32.png) [@shivendra95](https://discuss.elastic.co/u/shivendra95)
#### Post date: [March 30, 2022, 5:24am UTC](https://discuss.elastic.co/t/how-to-create-rule-when-monitor-is-up-in-uptime/300940/3 "2022-03-30T05:24:46Z")

</div>

I added the action and selected run when as recovered in the same rule, but again I did not get any alerts when the monitor came back online again.

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/6/0/60c028d9e7dd9f67c4ada58d2ee20b74b7db058e.png)

---

<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: [April 27, 2022, 5:25am UTC](https://discuss.elastic.co/t/how-to-create-rule-when-monitor-is-up-in-uptime/300940/4 "2022-04-27T05:25:45Z")

</div>

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