# Postgresql Configuration

**URL:** https://discuss.elastic.co/t/postgresql-configuration/377792
**Category:** Beats
**Created:** [May 5, 2025, 5:20am UTC](https://discuss.elastic.co/t/postgresql-configuration/377792 "2025-05-05T05:20:38Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Abel\_Sherino](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/abel_sherino/32/140606_2.png) [@Abel\_Sherino](https://discuss.elastic.co/u/Abel_Sherino)
#### Post date: [May 5, 2025, 5:20am UTC](https://discuss.elastic.co/t/postgresql-configuration/377792/1 "2025-05-05T05:20:38Z")

</div>

```auto
- module: postgresql
  metricsets:
    - database
    - bgwriter
    - activity
  period: 10s
  hosts: ["postgres://127.0.0.1:5432/?sslmode=disable"]
  username: ceburupg
  password: "${POSTGRESQL_PWD}"

```

this is my postgresql.yml configuration when i have start metric beat after configuring I am getting an error

2025-05-05T10:49:33.264+0530 INFO [monitoring] log/log.go:131 Stopping metrics logging.

2025-05-05T10:49:33.280+0530 INFO instance/beat.go:469 metricbeat stopped.

2025-05-05T10:49:33.315+0530 ERROR instance/beat.go:958 Exiting: 3 errors: host parsing failed for postgresql-database: missing field accessing '0.password' (source:'C:\Program Files (x86)\Ceburu\Metricbeat\modules.d\postgresql.yml'); host parsing failed for postgresql-bgwriter: missing field accessing '0.password' (source:'C:\Program Files (x86)\Ceburu\Metricbeat\modules.d\postgresql.yml'); host parsing failed for postgresql-activity: missing field accessing '0.password' (source:'C:\Program Files (x86)\Ceburu\Metricbeat\modules.d\postgresql.yml')

---

<div class="post-metadata">

### Author: ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)
#### Post date: [May 5, 2025, 6:30am UTC](https://discuss.elastic.co/t/postgresql-configuration/377792/2 "2025-05-05T06:30:08Z")

</div>

Hi @Abel_Sherino Welcome to the community.

Did you put the `POSTGRESQL_PWD` in the keystone?

> **[Secrets keystore for secure settings | Elastic Documentation](https://www.elastic.co/docs/reference/beats/metricbeat/keystore)**
>
> When you configure Metricbeat, you might need to specify sensitive settings, such as passwords. Rather than relying on file system permissions to protect...

I would suggest hardcore the password and test .. then use the keystore

---

<div class="post-metadata">

### Author: ![Abel\_Sherino](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/abel_sherino/32/140606_2.png) [@Abel\_Sherino](https://discuss.elastic.co/u/Abel_Sherino)
#### Post date: [May 5, 2025, 6:50am UTC](https://discuss.elastic.co/t/postgresql-configuration/377792/3 "2025-05-05T06:50:18Z")

</div>

Yes I did that but still I have an issue.

 ![Screenshot (83)](https://us1.discourse-cdn.com/elastic/original/3X/f/f/ffd6e6af94f373f50b742be0d85657619cd30968.png)

---

<div class="post-metadata">

### Author: ![Abel\_Sherino](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/abel_sherino/32/140606_2.png) [@Abel\_Sherino](https://discuss.elastic.co/u/Abel_Sherino)
#### Post date: [May 5, 2025, 2:04pm UTC](https://discuss.elastic.co/t/postgresql-configuration/377792/4 "2025-05-05T14:04:45Z")

</div>

When I use this configuration it works

- module: postgresql  
metricsets:
  - database
  - bgwriter
  - activity  
period: 10s  
hosts: ["postgres://127.0.0.1:5432/?sslmode=disable"]  
username: \*\*\*\*\*\*  
password: \*\*\*\*\*\*\*\*\*

---

<div class="post-metadata">

### Author: ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)
#### Post date: [May 5, 2025, 4:38pm UTC](https://discuss.elastic.co/t/postgresql-configuration/377792/5 "2025-05-05T16:38:19Z")

</div>

Try removing the value from the keystore and put it back in you can also display the value.... Something simple.. the keystore does work last I tried it.
