How to connect postgresql with kibana via metricbeat

I have tried to access data from postgresql and visualise in kibana through metricbeat. I couldn't establish the connection properly. Can anyone help me for this issue ?

I configured and enabled the postgresql module in metricbeat and started it. I can see the syncing process is going on through log. Also a metricbeat index is added in kibana.

Doing this process, I couldn't find where i have to provide the database name, uname , pwd. Also no fields from database is added into the index.

Please help me on fixing this...

Thanks in Advance

Hi @Aslam,

What kind of data do you want to visualize? Metricbeat is intended to be used to collect only metrics, send them to Elasticsearch and then visualize them on Kibana. But it cannot be used to visualize any data stored in postgresql.
You can see in the documentation how to configure the authentication for the module.

If you want to index in Elasticsearch all the data you have in the database you can use logstash with the jdbc plugin, you can see an example in this blogpost:

Hi jsoriano,
Thank you for your great support.
So, for visualising the data in the postgresql tables, the only way is using logstash with logstash-jdbc plugin right?
Will that syncs/index the data in the postgresql database with elasticsearch with a periodic schedule?

Yes, if you want to visualize the data in the the tables you cannot use beats, but you can use logstash.

The plugin can be configured with a scheduler, in that case the query is executed periodically and the result indexed in elasticsearch, with a document per row, if you want to keep documents updated you need to specify a document_id in the elasticsearch output, as in the second example in this blogpost.

Another option, if the data in your database is never updated and you want to index in each execution only the more recent rows, is to use sql_last_value in your query.

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