# Kibana Alert When No Metricbeat Data - to include hostname

**URL:** <https://discuss.elastic.co/t/kibana-alert-when-no-metricbeat-data-to-include-hostname/310048>\
**Category:** Kibana\
**Created:** [July 19, 2022, 4:15pm UTC](https://discuss.elastic.co/t/kibana-alert-when-no-metricbeat-data-to-include-hostname/310048 "2022-07-19T16:15:14Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![abidub](https://avatars.discourse-cdn.com/v4/letter/a/d07c76/32.png) [@abidub](https://discuss.elastic.co/u/abidub)\
**Post date:** [July 19, 2022, 4:15pm UTC](https://discuss.elastic.co/t/kibana-alert-when-no-metricbeat-data-to-include-hostname/310048/1 "2022-07-19T16:15:14Z")

</div>

Hi there,

I would like to receive an alert when any of the hosts that I have Metricbeat installed on, now longer reports in data, for whatever reason (it could be stopped, server is turned off etc.).

I want to avoid having to maintain an inventory list of servers I have installed Metricbeat on.

I know I can do an elastic query to check of metricbeat returns any hits for a particular server/servers, but is there any clever way to configure a simple alert that just tells me Metricbeat has no hits from a [hostname(s)], without me having to provide the hostnames to query.

If I do need to provide the hostnames, I am having trouble in returning that hostname in a watcher payload because hits = 0.

Any direction appreciated

Thanks

---

<div class="post-metadata">

**Author:** ![Marius\_Dragomir](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marius_dragomir/32/42087_2.png) [@Marius\_Dragomir](https://discuss.elastic.co/u/Marius_Dragomir)\
**Post date:** [July 23, 2022, 5:31pm UTC](https://discuss.elastic.co/t/kibana-alert-when-no-metricbeat-data-to-include-hostname/310048/2 "2022-07-23T17:31:45Z")

</div>

You can use Alerting instead of Watcher. This allows you to configure a Log Threshold rule something like this:

 ![logt](https://us1.discourse-cdn.com/elastic/original/3X/9/b/9b176139deb90ff237214a90636e46c2ae27b4ff.png)

Just replace the field names and intervals to what fits your data. For example instead of machine.os.keyword, use hostname and for geo.src use a field in the metricbeat documents that will always be there.

---

<div class="post-metadata">

**Author:** ![abidub](https://avatars.discourse-cdn.com/v4/letter/a/d07c76/32.png) [@abidub](https://discuss.elastic.co/u/abidub)\
**Post date:** [August 6, 2022, 12:11pm UTC](https://discuss.elastic.co/t/kibana-alert-when-no-metricbeat-data-to-include-hostname/310048/3 "2022-08-06T12:11:54Z")

</div>

Thank you! That worked great

---

<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:** [September 3, 2022, 12:12pm UTC](https://discuss.elastic.co/t/kibana-alert-when-no-metricbeat-data-to-include-hostname/310048/4 "2022-09-03T12:12:11Z")

</div>

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