# Alerting on no data with a specific rule

**URL:** https://discuss.elastic.co/t/alerting-on-no-data-with-a-specific-rule/357306
**Category:** Kibana
**Tags:** elastic-stack-alerting
**Created:** [April 12, 2024, 3:38pm UTC](https://discuss.elastic.co/t/alerting-on-no-data-with-a-specific-rule/357306 "2024-04-12T15:38:39Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![ElasticLiver](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/elasticliver/32/64869_2.png) [@ElasticLiver](https://discuss.elastic.co/u/ElasticLiver)
#### Post date: [April 12, 2024, 3:38pm UTC](https://discuss.elastic.co/t/alerting-on-no-data-with-a-specific-rule/357306/1 "2024-04-12T15:38:39Z")

</div>

Hi, Im monitoring remote Postgres and MSSql databases with metricbeat, metricbeat is installed in a local server that get data from the remote sources and  
` need to alert when I dont get data.`  
In the module configuration I have added a field (psql.name) to identify the connections with the DB.  
I collect data every 5 minutes.

My question is if the configuration below will work, I ask this because I think (not sure) I once saw documents with error messages when can not connect with the database, so metricbeat is not retriving metrics but documents with errors are produced so the alert wont trigger because those documents.

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

Thanks!
