# How to get notification when alert condition is cleared

**URL:** <https://forum.opensearch.org/t/how-to-get-notification-when-alert-condition-is-cleared/4853>\
**Category:** Alerting\
**Created:** [February 4, 2021, 1:42am UTC](https://forum.opensearch.org/t/how-to-get-notification-when-alert-condition-is-cleared/4853 "2021-02-04T01:42:52Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![pavanb](https://avatars.discourse-cdn.com/v4/letter/p/848f3c/32.png) [@pavanb](https://forum.opensearch.org/u/pavanb)\
**Post date:** [February 4, 2021, 1:42am UTC](https://forum.opensearch.org/t/how-to-get-notification-when-alert-condition-is-cleared/4853/1 "2021-02-04T01:42:52Z")

</div>

I am able to trigger and get notification when alert condition becomes Active. However I don’t get notifications when the alert condition clears (goes to Completed). Is there a way to get notified at the end of the alert condition?

---

<div class="post-metadata">

**Author:** ![pavanb](https://avatars.discourse-cdn.com/v4/letter/p/848f3c/32.png) [@pavanb](https://forum.opensearch.org/u/pavanb)\
**Post date:** [February 12, 2021, 6:33am UTC](https://forum.opensearch.org/t/how-to-get-notification-when-alert-condition-is-cleared/4853/2 "2021-02-12T06:33:59Z")

</div>

Folks, appreciate any input on this.

Thanks

---

<div class="post-metadata">

**Author:** ![qreshi](https://avatars.discourse-cdn.com/v4/letter/q/aca169/32.png) [@qreshi](https://forum.opensearch.org/u/qreshi)\
**Post date:** [February 15, 2021, 5:56pm UTC](https://forum.opensearch.org/t/how-to-get-notification-when-alert-condition-is-cleared/4853/3 "2021-02-15T17:56:16Z")

</div>

Hi @pavanb,

This currently is not supported but has been captured in a [GitHub issue](https://github.com/opendistro-for-elasticsearch/alerting/issues/169). We will seek to support this in the future.

---

<div class="post-metadata">

**Author:** ![pavanb](https://avatars.discourse-cdn.com/v4/letter/p/848f3c/32.png) [@pavanb](https://forum.opensearch.org/u/pavanb)\
**Post date:** [February 16, 2021, 5:18am UTC](https://forum.opensearch.org/t/how-to-get-notification-when-alert-condition-is-cleared/4853/4 "2021-02-16T05:18:32Z")

</div>

Hi @qreshi,

Thanks for the clarification. We are very interested in getting this functionality, would really appreciate if you could prioritize.  
In the meantime, what is the best way to check for alerts that got cleared? Can we poll via API?

Thanks  
-Pavan

---

<div class="post-metadata">

**Author:** ![qreshi](https://avatars.discourse-cdn.com/v4/letter/q/aca169/32.png) [@qreshi](https://forum.opensearch.org/u/qreshi)\
**Post date:** [February 17, 2021, 10:16pm UTC](https://forum.opensearch.org/t/how-to-get-notification-when-alert-condition-is-cleared/4853/5 "2021-02-17T22:16:10Z")

</div>

If you are using ODFE 1.10+, there was a `GET alerts` API [that was added](https://github.com/opendistro-for-elasticsearch/alerting/blob/main/alerting/src/main/kotlin/com/amazon/opendistroforelasticsearch/alerting/resthandler/RestGetAlertsAction.kt).

You can retrieve alerts and filter on `monitorId` and `alertState` or supply a `searchString` argument for a more custom search. Example of simple usage:

```auto
GET _opendistro/_alerting/monitors/alerts?alertState=ACKNOWLEDGED

```

It looks like this API is not being reflected in the documentation, I’ve created [an issue](https://github.com/opendistro/for-elasticsearch-docs/issues/417) to track this change.

Also, if you’re using an ODFE version less than 1.10, you can just query the `.opendistro-alerting-alerts` index directly as a workaround.

Hope that helps!

---

<div class="post-metadata">

**Author:** ![pavanb](https://avatars.discourse-cdn.com/v4/letter/p/848f3c/32.png) [@pavanb](https://forum.opensearch.org/u/pavanb)\
**Post date:** [February 18, 2021, 12:13am UTC](https://forum.opensearch.org/t/how-to-get-notification-when-alert-condition-is-cleared/4853/6 "2021-02-18T00:13:11Z")

</div>

Thanks for the API details. Will try it out.
