# Is it possible to create an alert in case an Elastic Agent goes offline?

**URL:** <https://discuss.elastic.co/t/is-it-possible-to-create-an-alert-in-case-an-elastic-agent-goes-offline/346878>\
**Category:** Elastic Agent\
**Tags:** elastic-stack-alerting\
**Created:** [November 10, 2023, 2:30pm UTC](https://discuss.elastic.co/t/is-it-possible-to-create-an-alert-in-case-an-elastic-agent-goes-offline/346878 "2023-11-10T14:30:38Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![SamuelSMendes](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/samuelsmendes/32/104246_2.png) [@SamuelSMendes](https://discuss.elastic.co/u/SamuelSMendes)\
**Post date:** [November 10, 2023, 2:30pm UTC](https://discuss.elastic.co/t/is-it-possible-to-create-an-alert-in-case-an-elastic-agent-goes-offline/346878/1 "2023-11-10T14:30:38Z")

</div>

I have a few Elastic-Agents working on metric collection but we got a problem for when one of them goes down. I know so far that there's an alerting option for metrics/logs threshold but I'm not sure about how to set an alert for when there's missing data.

It would be great to have some ideas on this topic.

Best regards!

---

<div class="post-metadata">

**Author:** ![sholzhauer](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sholzhauer/32/110282_2.png) [@sholzhauer](https://discuss.elastic.co/u/sholzhauer)\
**Post date:** [November 10, 2023, 10:55pm UTC](https://discuss.elastic.co/t/is-it-possible-to-create-an-alert-in-case-an-elastic-agent-goes-offline/346878/2 "2023-11-10T22:55:47Z")

</div>

Would a new terms query in the detection rules be an option?

You could query for the status offline and use new term aggregation on host name.

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [November 11, 2023, 12:55am UTC](https://discuss.elastic.co/t/is-it-possible-to-create-an-alert-in-case-an-elastic-agent-goes-offline/346878/3 "2023-11-11T00:55:03Z")

</div>

If you collect system metrics you can just create a metric alert and there's an option to be alerted when it stop sending data.

But seems like there should be an easier way.

I also saw this

> [@Elastic Fleet: Alert on Agent Status](https://discuss.elastic.co/t/elastic-fleet-alert-on-agent-status/333502/2):
>
> Hi @DougR , thanks for posting. Unforutanetly I think there is not such functionality in Kibana. I found this feature request by @Jeff_Vestal You can create rules based on your agent writes (like the System integration writing at the logs-\* data stream with data\_stream.dataset: elastic\_agent) but I concur that is not ideal. Example of a single agent writing data in the logs-\* data view, filtering to show activity from the agent itself, filebeat and metricbeat

---

<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 9, 2023, 12:55am UTC](https://discuss.elastic.co/t/is-it-possible-to-create-an-alert-in-case-an-elastic-agent-goes-offline/346878/4 "2023-12-09T00:55:18Z")

</div>

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