# Connection Refused on localhost

**URL:** https://discuss.elastic.co/t/connection-refused-on-localhost/85624
**Category:** Beats
**Tags:** filebeat
**Created:** [May 12, 2017, 9:22pm UTC](https://discuss.elastic.co/t/connection-refused-on-localhost/85624 "2017-05-12T21:22:29Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![dodegaard](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dodegaard/32/18177_2.png) [@dodegaard](https://discuss.elastic.co/u/dodegaard)
#### Post date: [May 12, 2017, 9:22pm UTC](https://discuss.elastic.co/t/connection-refused-on-localhost/85624/1 "2017-05-12T21:22:29Z")

</div>

I have setup latest bits of Elastic, Logstash, Kibana and Filebeat all on my local machine (OSX 10.12.3) and am getting a "Connection Refused" when filebeat tries to publish them. I have done a successful telnet when logstash is up which puzzles me. I am using the logstash.beat.config plugin to fire up logstash.

To start logstash  
`bin/logstash -f logstash-beats.conf`

To start filebeat  
`sudo ./filebeat -e -c filebeat.yml -d "publish"`

Here is some of my output  
2017/05/12 21:13:26.267729 client.go:214: DBG Publish: {  
"@timestamp": "2017-05-12T21:13:26.076Z",  
"beat": {  
"hostname": "dodegaard-MBA.local",  
"name": "savm002",  
"version": "5.4.0"  
},  
"input\_type": "log",  
"message": "04/05/2017 19:46:03 instance|044444444\tfetch\_time|1.1006\ttotal\_accounts|5\trt\_accounts|0\trt\_account\_status|Current\trt\_time\_acct|\terror\_data|\ttarget\_url|\tuserlogon|",  
"offset": 199086,  
"source": "/users/dodegaard/documents/siteagentlogs\_sample/0400\_SD40040.log.04-05-2017",  
"tags": [  
"x002",  
"legacy-tier"  
],  
"type": "log"  
}  
2017/05/12 21:13:26.267755 output.go:109: DBG output worker: publish 50 events  
2017/05/12 21:13:26.284814 single.go:140: ERR Connecting error publishing events (retrying): Get [http://127.0.0.1:5044](http://127.0.0.1:5044): read tcp 127.0.0.1:58367-\>127.0.0.1:5044: read: connection reset by peer  
2017/05/12 21:13:27.299930 single.go:140: ERR Connecting error publishing events (retrying): Get [http://127.0.0.1:5044](http://127.0.0.1:5044): read tcp 127.0.0.1:58368-\>127.0.0.1:5044: read: connection reset by peer  
2017/05/12 21:13:29.306082 single.go:140: ERR Connecting error publishing events (retrying): Get [http://127.0.0.1:5044](http://127.0.0.1:5044): read tcp 127.0.0.1:58369-\>127.0.0.1:5044: read: connection reset by peer  
2017/05/12 21:13:33.310978 single.go:140: ERR Connecting error publishing events (retrying): Get [http://127.0.0.1:5044](http://127.0.0.1:5044): read tcp 127.0.0.1:58370-\>127.0.0.1:5044: read: connection reset by peer  
2017/05/12 21:13:41.316694 single.go:140: ERR Connecting error publishing events (retrying): Get [http://127.0.0.1:5044](http://127.0.0.1:5044): read tcp 127.0.0.1:58371-\>127.0.0.1:5044: read: connection reset by peer  
2017/05/12 21:13:56.032021 metrics.go:39: INFO Non-zero metrics in the last 30s: filebeat.harvester.open\_files=3 filebeat.harvester.running=3 filebeat.harvester.started=3 libbeat.es.publish.read\_errors=5 libbeat.es.publish.write\_bytes=605 libbeat.publisher.published\_events=2045  
2017/05/12 21:13:57.320940 single.go:140: ERR Connecting error publishing events (retrying): Get [http://127.0.0.1:5044](http://127.0.0.1:5044): read tcp 127.0.0.1:58375-\>127.0.0.1:5044: read: connection reset by peer

I am not interested in going directly to elasticsearch but want this to traffic through logstash.

Thank you so much in advance for your help.  
d

---

<div class="post-metadata">

### Author: ![dodegaard](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dodegaard/32/18177_2.png) [@dodegaard](https://discuss.elastic.co/u/dodegaard)
#### Post date: [May 14, 2017, 4:16am UTC](https://discuss.elastic.co/t/connection-refused-on-localhost/85624/2 "2017-05-14T04:16:01Z")

</div>

I figured it out. I had uncommented the hosts section but not the output.logstash. Duh. Hope this helps someone take a sharp look at their yml file.

---

<div class="post-metadata">

### Author: ![exekias](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/exekias/32/28718_2.png) [@exekias](https://discuss.elastic.co/u/exekias)
#### Post date: [May 15, 2017, 11:08am UTC](https://discuss.elastic.co/t/connection-refused-on-localhost/85624/3 "2017-05-15T11:08:57Z")

</div>

I'm glad you found the solution, if you mark your last comment as solution it will help others to find it better 🙂

regards

---

<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: [June 12, 2017, 11:11am UTC](https://discuss.elastic.co/t/connection-refused-on-localhost/85624/4 "2017-06-12T11:11:26Z")

</div>

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