Alerting on no data with a specific rule

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.

Thanks!