# Setup of beat exporter doesn't work

**URL:** <https://discuss.elastic.co/t/setup-of-beat-exporter-doesnt-work/238433>\
**Category:** Beats\
**Tags:** filebeat\
**Created:** [June 24, 2020, 10:14am UTC](https://discuss.elastic.co/t/setup-of-beat-exporter-doesnt-work/238433 "2020-06-24T10:14:02Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![vaishno.avi](https://avatars.discourse-cdn.com/v4/letter/v/f0a364/32.png) [@vaishno.avi](https://discuss.elastic.co/u/vaishno.avi)\
**Post date:** [June 24, 2020, 10:14am UTC](https://discuss.elastic.co/t/setup-of-beat-exporter-doesnt-work/238433/1 "2020-06-24T10:14:02Z")

</div>

Hello,

I wanted to export filebeat metrics via beat exporter.

- filebeat has a conf that exposes the metrics [https://www.elastic.co/guide/en/beats/filebeat/master/http-endpoint.html](https://www.elastic.co/guide/en/beats/filebeat/master/http-endpoint.html)

- beat exporter's documentation also tells me to do the same [https://github.com/trustpilot/beat-exporter/blob/master/readme.md#setup](https://github.com/trustpilot/beat-exporter/blob/master/readme.md#setup)

- Filebeat and beat-exporter are running on the same host in the same docker bridge network

- Out of the box this config doesn't work. To make it work I had to change  
`http: enabled: true host: localhost port: 5066`  
to  
`http: enabled: true host: 0.0.0.0 port: 5066`  
Why localhost config doesn't work : If the process _inside_ the container is bound to localhost, localhost uses a special loopback interface that is distinct from regular networking. I am able to access the service from within the container (host) but you won't be able to route its traffic externally

- In doing so I make the setup work for filebeat and beat-exporter, but cause issues between logstash and filebeat.(filebeat and logstash running on different server) filebeat logs  
`2020-06-23T10:50:06.823+0200	ERROR	logstash/async.go:256	Failed to publish events caused by: read tcp X.X.X.X:40590->X.X.X.X:5050: read: connection reset by peer 2020-06-23T10:50:06.894+0200	ERROR	logstash/async.go:256	Failed to publish events caused by: client is not connected 2020-06-23T10:50:08.708+0200	ERROR	pipeline/output.go:121	Failed to publish events: client is not connected`

[24th June 2020 14:36 PM] Noticed something :  
As soon as I stop beat exporter and restart the filebeat instance, the above mentioned error do not appear and filebeat/logstash work as expected

- So the setup has a container of filebeat and beat-exporter running on application-server and logstash running on a my log-server
- With the below config in filebeat. filebeat and logstash work (so i will rule out the possibility that 0.0.0.0 doesn't work )

http:  
enabled: true  
host: 0.0.0.0  
port: 5066

- Now when i start beat-exporter, I start to see the above errors (not sure what could cause it)
- But even after stopping beat-exporter the above errors persist and it only gets resolved once i restart filebeat

Regards  
Ashish

---

<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 22, 2020, 12:14pm UTC](https://discuss.elastic.co/t/setup-of-beat-exporter-doesnt-work/238433/2 "2020-07-22T12:14:10Z")

</div>

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