# Failing to send beats from Postgres

**URL:** https://discuss.elastic.co/t/failing-to-send-beats-from-postgres/167556
**Category:** Beats
**Tags:** metricbeat
**Created:** [February 7, 2019, 11:53pm UTC](https://discuss.elastic.co/t/failing-to-send-beats-from-postgres/167556 "2019-02-07T23:53:39Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![juanmav](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/juanmav/32/40704_2.png) [@juanmav](https://discuss.elastic.co/u/juanmav)
#### Post date: [February 7, 2019, 11:53pm UTC](https://discuss.elastic.co/t/failing-to-send-beats-from-postgres/167556/1 "2019-02-07T23:53:39Z")

</div>

I've configured and enabled the postgresql module with the following config:

```auto
# Module: postgresql
# Docs: https://www.elastic.co/guide/en/beats/metricbeat/6.x/metricbeat-module-postgresql.html

- module: postgresql
  metricsets:
    - database
  # - bgwriter
  # - activity
  period: 5s
  hosts: ["postgres://myurl.com:5432"]
  username: myuser
  password: mypassword

```

But I can't make it work, the url, user and password are ok and the user has permission to query the databases activities.

The ouput config from metricbeats is:

```auto
|2019-02-07T20:50:43.588-0300|INFO|[monitoring]|log/log.go:144|Non-zero metrics in the last 30s|{"monitoring": {"metrics": {"beat":{"cpu":{"system":{"ticks":160,"time":{"ms":22}},"total":{"ticks":500,"time":{"ms":29},"value":500},"user":{"ticks":340,"time":{"ms":7}}},"handles":{"limit":{"hard":4096,"soft":1024},"open":16},"info":{"ephemeral_id":"2042107a-3fdd-4231-aed5-3a670e0046b0","uptime":{"ms":363027}},"memstats":{"gc_next":7972560,"memory_alloc":6826496,"memory_total":40320744}},"libbeat":{"config":{"module":{"running":0}},"output":{"events":{"acked":7,"batches":7,"total":7},"read":{"bytes":3913},"write":{"bytes":7018}},"pipeline":{"clients":2,"events":{"active":0,"published":6,"total":6},"queue":{"acked":7}}},"metricbeat":{"postgresql":{"database":{"events":6,"failures":6}}},"system":{"load":{"1":0.71,"15":0.87,"5":0.81,"norm":{"1":0.0888,"15":0.1088,"5":0.1013}}}}}}|
|---|---|---|---|---|---|
|2019-02-07T20:51:13.588-0300|INFO|[monitoring]|log/log.go:144|Non-zero metrics in the last 30s|{"monitoring": {"metrics": {"beat":{"cpu":{"system":{"ticks":170,"time":{"ms":10}},"total":{"ticks":540,"time":{"ms":33},"value":540},"user":{"ticks":370,"time":{"ms":23}}},"handles":{"limit":{"hard":4096,"soft":1024},"open":10},"info":{"ephemeral_id":"2042107a-3fdd-4231-aed5-3a670e0046b0","uptime":{"ms":393028}},"memstats":{"gc_next":7959424,"memory_alloc":5168488,"memory_total":42040872,"rss":1118208}},"libbeat":{"config":{"module":{"running":0}},"output":{"events":{"acked":5,"batches":5,"total":5},"read":{"bytes":2795},"write":{"bytes":5019}},"pipeline":{"clients":2,"events":{"active":0,"published":5,"total":5},"queue":{"acked":5}}},"metricbeat":{"postgresql":{"database":{"events":5,"failures":5}}},"system":{"load":{"1":0.65,"15":0.86,"5":0.78,"norm":{"1":0.0813,"15":0.1075,"5":0.0975}}}}}}|

```

I've also configure the cloud.id and the cloud.auth parameters and the elastic and kibana were automatically configured. The modele system is sending logs ok when it is configured.

The postgres version is 10.4

Any ideas?

Thanks in advance  
Juan Manuel

---

<div class="post-metadata">

### Author: ![Mario\_Castro](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mario_castro/32/35107_2.png) [@Mario\_Castro](https://discuss.elastic.co/u/Mario_Castro)
#### Post date: [February 8, 2019, 11:00am UTC](https://discuss.elastic.co/t/failing-to-send-beats-from-postgres/167556/2 "2019-02-08T11:00:37Z")

</div>

Hi @juanmav 🙂

I have just tested the module with the `10.4` Docker image without problem so we can discard an version issue. Maybe `ssl` isn't enabled on the instance, can you try setting hosts to `hosts: ["postgres://myurl.com:5432?sslmode=disable"]`, please?

---

<div class="post-metadata">

### Author: ![juanmav](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/juanmav/32/40704_2.png) [@juanmav](https://discuss.elastic.co/u/juanmav)
#### Post date: [February 8, 2019, 2:34pm UTC](https://discuss.elastic.co/t/failing-to-send-beats-from-postgres/167556/3 "2019-02-08T14:34:24Z")

</div>

@Mario_Castro thanks for the reply (and the formatting of my post) I've added that you suggested and now it is working 🙂

Thanks!

---

<div class="post-metadata">

### Author: ![Mario\_Castro](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mario_castro/32/35107_2.png) [@Mario\_Castro](https://discuss.elastic.co/u/Mario_Castro)
#### Post date: [February 11, 2019, 2:21pm UTC](https://discuss.elastic.co/t/failing-to-send-beats-from-postgres/167556/4 "2019-02-11T14:21:16Z")

</div>

Awesome! I'm glad that it worked!

---

<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: [March 11, 2019, 2:21pm UTC](https://discuss.elastic.co/t/failing-to-send-beats-from-postgres/167556/5 "2019-03-11T14:21:17Z")

</div>

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