Postgresql Configuration

- 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')

Hi @Abel_Sherino Welcome to the community.

Did you put the POSTGRESQL_PWD in the keystone?

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

Yes I did that but still I have an issue.

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: *********

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.