# Metricbeat - PostgreSQL authentication method

**URL:** https://discuss.elastic.co/t/metricbeat-postgresql-authentication-method/239641
**Category:** Beats
**Tags:** metricbeat
**Created:** [July 2, 2020, 1:17pm UTC](https://discuss.elastic.co/t/metricbeat-postgresql-authentication-method/239641 "2020-07-02T13:17:52Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![adminunix](https://avatars.discourse-cdn.com/v4/letter/a/f07891/32.png) [@adminunix](https://discuss.elastic.co/u/adminunix)
#### Post date: [July 2, 2020, 1:17pm UTC](https://discuss.elastic.co/t/metricbeat-postgresql-authentication-method/239641/1 "2020-07-02T13:17:52Z")

</div>

Hello,

I am trying to use postgresql module for metricbeat but I get the following error:

```
error in QueryStats: failed to obtain a connection with the database: pq: Ident authentication failed for user "postgres"

```

My PostgreSQL database is configured with the Ident authentication method:

```
# IPv4 local connections:
host all all 127.0.0.1/32 ident

```

And postgresql module config file is:

```
[root@system ~]# cat /etc/metricbeat/modules.d/postgresql.yml
# Module: postgresql
# Docs: https://www.elastic.co/guide/en/beats/metricbeat/7.8/metricbeat-module-postgresql.html

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

```

Is there any form to use Ident authentication with postgresql module?

thanks,  
Arturo.

---

<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: [July 30, 2020, 3:18pm UTC](https://discuss.elastic.co/t/metricbeat-postgresql-authentication-method/239641/2 "2020-07-30T15:18:01Z")

</div>

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