# Unable to get visualize data from postgres fusing metricbeat

**URL:** <https://discuss.elastic.co/t/unable-to-get-visualize-data-from-postgres-fusing-metricbeat/107760>\
**Category:** Beats\
**Tags:** metricbeat\
**Created:** [November 15, 2017, 1:55pm UTC](https://discuss.elastic.co/t/unable-to-get-visualize-data-from-postgres-fusing-metricbeat/107760 "2017-11-15T13:55:48Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dinesh\_Senthil\_Kumar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dinesh_senthil_kumar/32/48983_2.png) [@Dinesh\_Senthil\_Kumar](https://discuss.elastic.co/u/Dinesh_Senthil_Kumar)\
**Post date:** [November 15, 2017, 1:55pm UTC](https://discuss.elastic.co/t/unable-to-get-visualize-data-from-postgres-fusing-metricbeat/107760/1 "2017-11-15T13:55:48Z")

</div>

Hi,

i am using elk 5.6, i have installed elasticsearch and kibana successfully. i have configured metric beat , i am able to get all cpu metrics but am not gettign any metrics regrding postgres.

while the metric beat log says it is sending data to elastisearch. but when i try to visualize am gettign null value for all the postgres related data. kindly help to resolve the same.  
also is there a standard dashboard for postgres.

---

<div class="post-metadata">

**Author:** ![ruflin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ruflin/32/3116_2.png) [@ruflin](https://discuss.elastic.co/u/ruflin)\
**Post date:** [November 16, 2017, 4:38am UTC](https://discuss.elastic.co/t/unable-to-get-visualize-data-from-postgres-fusing-metricbeat/107760/2 "2017-11-16T04:38:10Z")

</div>

Can you share your metricbeat config and the logs?

---

<div class="post-metadata">

**Author:** ![Dinesh\_Senthil\_Kumar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dinesh_senthil_kumar/32/48983_2.png) [@Dinesh\_Senthil\_Kumar](https://discuss.elastic.co/u/Dinesh_Senthil_Kumar)\
**Post date:** [November 16, 2017, 5:44am UTC](https://discuss.elastic.co/t/unable-to-get-visualize-data-from-postgres-fusing-metricbeat/107760/3 "2017-11-16T05:44:31Z")

</div>

hi rufin pfb the error log i am getting from metric beat.  
2017/11/16 05:41:27.217642 wrapper.go:201: DBG Stopped metricSetWrapper[module=system, name=diskio, host=]  
2017/11/16 05:41:27.217650 wrapper.go:201: DBG Stopped metricSetWrapper[module=system, name=filesystem, host=]  
2017/11/16 05:41:27.217666 wrapper.go:201: DBG Stopped metricSetWrapper[module=system, name=core, host=]  
2017/11/16 05:41:27.217631 wrapper.go:201: DBG Stopped metricSetWrapper[module=system, name=load, host=]  
2017/11/16 05:41:27.217672 wrapper.go:201: DBG Stopped metricSetWrapper[module=system, name=cpu, host=]  
2017/11/16 05:41:27.217675 wrapper.go:201: DBG Stopped metricSetWrapper[module=postgresql, name=activity, host=172.21.197.195:5444]  
2017/11/16 05:41:27.217982 metrics.go:51: INFO Total non-zero values: fetches.postgresql-activity.events=2 fetches.postgresql-activity.failures=2 fetches.postgresql-bgwriter.events=4 fetches.postgresql-bgwriter.failures=4 fetches.postgresql-database.events=2 fetches.postgresql-database.failures=2 fetches.system-core.events=12 fetches.system-core.success=2 fetches.system-cpu.events=2 fetches.system-cpu.success=2 fetches.system-diskio.events=16 fetches.system-diskio.success=2 fetches.system-filesystem.events=84 fetches.system-filesystem.success=2 fetches.system-fsstat.events=2 fetches.system-fsstat.success=2 fetches.system-load.events=2 fetches.system-load.success=2 fetches.system-memory.events=2 fetches.system-memory.success=2 fetches.system-network.events=10 fetches.system-network.success=2 fetches.system-process.events=1120 fetches.system-process.success=2 libbeat.es.call\_count.PublishEvents=26 libbeat.es.publish.read\_bytes=12765 libbeat.es.publish.write\_bytes=690304 libbeat.es.published\_and\_acked\_events=1258 libbeat.publisher.messages\_in\_worker\_queues=1258 libbeat.publisher.published\_events=1258  
2017/11/16 05:41:27.218001 metrics.go:52: INFO Uptime: 15.258655504s  
2017/11/16 05:41:27.218005 beat.go:237: INFO metricbeat stopped.  
2017/11/16 05:41:27.217642 wrapper.go:201: DBG Stopped metricSetWrapper[module=system, name=diskio, host=]  
2017/11/16 05:41:27.217650 wrapper.go:201: DBG Stopped metricSetWrapper[module=system, name=filesystem, host=]  
2017/11/16 05:41:27.217666 wrapper.go:201: DBG Stopped metricSetWrapper[module=system, name=core, host=]  
2017/11/16 05:41:27.217631 wrapper.go:201: DBG Stopped metricSetWrapper[module=system, name=load, host=]  
2017/11/16 05:41:27.217672 wrapper.go:201: DBG Stopped metricSetWrapper[module=system, name=cpu, host=]  
2017/11/16 05:41:27.217675 wrapper.go:201: DBG Stopped metricSetWrapper[module=postgresql, name=activity, host=172.21.197.195:5444]  
2017/11/16 05:41:27.217982 metrics.go:51: INFO Total non-zero values: fetches.postgresql-activity.events=2 fetches.postgresql-activity.failures=2 fetches.postgresql-bgwriter.events=4 fetches.postgresql-bgwriter.failures=4 fetches.postgresql-database.events=2 fetches.postgresql-database.failures=2 fetches.system-core.events=12 fetches.system-core.success=2 fetches.system-cpu.events=2 fetches.system-cpu.success=2 fetches.system-diskio.events=16 fetches.system-diskio.success=2 fetches.system-filesystem.events=84 fetches.system-filesystem.success=2 fetches.system-fsstat.events=2 fetches.system-fsstat.success=2 fetches.system-load.events=2 fetches.system-load.success=2 fetches.system-memory.events=2 fetches.system-memory.success=2 fetches.system-network.events=10 fetches.system-network.success=2 fetches.system-process.events=1120 fetches.system-process.success=2 libbeat.es.call\_count.PublishEvents=26 libbeat.es.publish.read\_bytes=12765 libbeat.es.publish.write\_bytes=690304 libbeat.es.published\_and\_acked\_events=1258 libbeat.publisher.messages\_in\_worker\_queues=1258 libbeat.publisher.published\_events=1258  
2017/11/16 05:41:27.218001 metrics.go:52: INFO Uptime: 15.258655504s  
2017/11/16 05:41:27.218005 beat.go:237: INFO metricbeat stopped.

---

<div class="post-metadata">

**Author:** ![Dinesh\_Senthil\_Kumar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dinesh_senthil_kumar/32/48983_2.png) [@Dinesh\_Senthil\_Kumar](https://discuss.elastic.co/u/Dinesh_Senthil_Kumar)\
**Post date:** [November 16, 2017, 5:45am UTC](https://discuss.elastic.co/t/unable-to-get-visualize-data-from-postgres-fusing-metricbeat/107760/4 "2017-11-16T05:45:13Z")

</div>

pfb the metricbeat.yml

```auto

#========================== Modules configuration ============================
metricbeat.modules:
  -
    module: system
    metricsets:
      - cpu
      - load
      - core
      - diskio
      - filesystem
      - fsstat
      - memory
      - network
      - process
    period: 10s
    processes:
      - .*
  -
    module: postgresql
    metricsets:
      - database
      - bgwriter
      - bgwriter
      - activity
    hosts:
      - "postgres://172.21.197.195:5444/SANTEDB"
    period: 10s

output.elasticsearch:
  hosts:
    - "172.21.197.152:9200"
# password: changeme
# username: elastic

logging.level: debug

```

---

<div class="post-metadata">

**Author:** ![ruflin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ruflin/32/3116_2.png) [@ruflin](https://discuss.elastic.co/u/ruflin)\
**Post date:** [November 16, 2017, 10:17pm UTC](https://discuss.elastic.co/t/unable-to-get-visualize-data-from-postgres-fusing-metricbeat/107760/5 "2017-11-16T22:17:28Z")

</div>

Any chance you could post a little bit a longer log and from the beginning when metricbeat starts up and then wait for about 60s? For a test run could you disable the system module?

For the log best paste it into a gist and link it here.

---

<div class="post-metadata">

**Author:** ![Dinesh\_Senthil\_Kumar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dinesh_senthil_kumar/32/48983_2.png) [@Dinesh\_Senthil\_Kumar](https://discuss.elastic.co/u/Dinesh_Senthil_Kumar)\
**Post date:** [November 17, 2017, 5:55am UTC](https://discuss.elastic.co/t/unable-to-get-visualize-data-from-postgres-fusing-metricbeat/107760/6 "2017-11-17T05:55:38Z")

</div>

Hi Ruflin

this is the error message i am getting, post commenting out the system module and trying only for the pgsql.

_ **"error": "QueryStats: pq: unexpected error: "setting PGLOCALEDIR not supported"",** _  
_\*\* "metricset":\*\*_

 ![m2](https://us1.discourse-cdn.com/elastic/original/3X/b/b/bb3fafdb0eef9c4573c95719e997e7fc5b13aef9.png) ![m1](https://us1.discourse-cdn.com/elastic/original/3X/3/8/38c40500ce6cc2116f39fce8012e883de6484c19.png) ![m2](https://us1.discourse-cdn.com/elastic/original/3X/b/b/bb3fafdb0eef9c4573c95719e997e7fc5b13aef9.png)

the PGLOCALEDIR dir is already set, let me know if metricbeat expects any specific locale. the below locale are present in my system. thanks in advance  
zh\_TW  
pt\_BR  
ta  
ja  
nb  
zh\_CN  
it  
de  
id  
es  
fr  
ro  
cs  
ru  
sv  
ko  
tr  
pl

---

<div class="post-metadata">

**Author:** ![ruflin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ruflin/32/3116_2.png) [@ruflin](https://discuss.elastic.co/u/ruflin)\
**Post date:** [November 19, 2017, 11:14pm UTC](https://discuss.elastic.co/t/unable-to-get-visualize-data-from-postgres-fusing-metricbeat/107760/7 "2017-11-19T23:14:54Z")

</div>

From the go client library we use: [pq package - github.com/lib/pq - Go Packages](https://godoc.org/github.com/lib/pq)

> Most environment variables as specified at [PostgreSQL: Documentation: 16: 34.15.&nbsp;Environment Variables](http://www.postgresql.org/docs/current/static/libpq-envars.html) supported by libpq are also supported by pq. If any of the environment variables not supported by pq are set, pq will panic during connection establishment. Environment variables have a lower precedence than explicitly provided connection parameters.

Can you try unset the env variable?

In the future please paste text instead of screenshots.

---

<div class="post-metadata">

**Author:** ![Dinesh\_Senthil\_Kumar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dinesh_senthil_kumar/32/48983_2.png) [@Dinesh\_Senthil\_Kumar](https://discuss.elastic.co/u/Dinesh_Senthil_Kumar)\
**Post date:** [November 29, 2017, 11:45am UTC](https://discuss.elastic.co/t/unable-to-get-visualize-data-from-postgres-fusing-metricbeat/107760/8 "2017-11-29T11:45:14Z")

</div>

> [@Dinesh\_Senthil\_Kumar](#):
>
> PGLOCALEDIR

HI Ruflin,  
post unsetting the PGLOCALEDIR env variable i am able to proceed with metricbeat. thanks fot the guidance.

---

<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 27, 2017, 11:45am UTC](https://discuss.elastic.co/t/unable-to-get-visualize-data-from-postgres-fusing-metricbeat/107760/9 "2017-12-27T11:45:22Z")

</div>

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