# Collecting postgres information from multiple machinesfrom one metricbeat instance

**URL:** <https://discuss.elastic.co/t/collecting-postgres-information-from-multiple-machinesfrom-one-metricbeat-instance/207864>\
**Category:** Beats\
**Tags:** metricbeat\
**Created:** [November 14, 2019, 10:43am UTC](https://discuss.elastic.co/t/collecting-postgres-information-from-multiple-machinesfrom-one-metricbeat-instance/207864 "2019-11-14T10:43:22Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Joseph\_John](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/joseph_john/32/53907_2.png) [@Joseph\_John](https://discuss.elastic.co/u/Joseph_John)\
**Post date:** [November 14, 2019, 10:43am UTC](https://discuss.elastic.co/t/collecting-postgres-information-from-multiple-machinesfrom-one-metricbeat-instance/207864/1 "2019-11-14T10:43:22Z")

</div>

Hi All,  
Good evening.  
I am trying to use metricbeat to get information about PostgreSQL, for one machine I am getting the information on the dashboard.

What I am aiming is to use the same metricbeat instance and postgresql.yml to enter information about all other server IP and other details and get the information

Can I do it, from the example, I can see only for one PostgreSQL instance  
thanks  
Joseph John

---

<div class="post-metadata">

**Author:** ![Joseph\_John](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/joseph_john/32/53907_2.png) [@Joseph\_John](https://discuss.elastic.co/u/Joseph_John)\
**Post date:** [November 14, 2019, 3:53pm UTC](https://discuss.elastic.co/t/collecting-postgres-information-from-multiple-machinesfrom-one-metricbeat-instance/207864/2 "2019-11-14T15:53:57Z")

</div>

Hi All,  
I guess this is the right way to do

> - module: postgresql  
> metricsets:
> - database
> - bgwriter
> - activity  
> period: 10s  
> hosts: ["postgres://192.168.3.191:5432"]  
> username: postgres  
> password: XX
> 
> **second instance here**
> 
> - module: postgresql  
> metricsets:
> - database
> - bgwriter
> - activity  
> period: 10s  
> hosts: ["postgres://192.168.3.1:5432"]  
> username: postgres  
> password: XX
> 
> **third instance**
> 
> -module: postgresql  
> metricsets:  
> - database  
> - bgwriter  
> - activity  
> period: 10s  
> hosts: ["postgres://192.168.3.10:5432"]  
> username: postgres  
> password: XX

---

<div class="post-metadata">

**Author:** ![Kaiyan\_Sheng](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kaiyan_sheng/32/38247_2.png) [@Kaiyan\_Sheng](https://discuss.elastic.co/u/Kaiyan_Sheng)\
**Post date:** [November 15, 2019, 3:23pm UTC](https://discuss.elastic.co/t/collecting-postgres-information-from-multiple-machinesfrom-one-metricbeat-instance/207864/3 "2019-11-15T15:23:16Z")

</div>

Just curious, does it work if you put all three ips in the same hosts in same config session? Like:

```auto
hosts: ["postgres://192.168.3.191:5432", "postgres://192.168.3.1:5432", "postgres://192.168.3.10:5432"]

```

---

<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 13, 2019, 3:23pm UTC](https://discuss.elastic.co/t/collecting-postgres-information-from-multiple-machinesfrom-one-metricbeat-instance/207864/4 "2019-12-13T15:23:21Z")

</div>

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