# Filebeats: ERR Connecting error publishing events

**URL:** https://discuss.elastic.co/t/filebeats-err-connecting-error-publishing-events/87837
**Category:** Logstash
**Created:** [June 1, 2017, 4:58am UTC](https://discuss.elastic.co/t/filebeats-err-connecting-error-publishing-events/87837 "2017-06-01T04:58:25Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![pace](https://avatars.discourse-cdn.com/v4/letter/p/c2a13f/32.png) [@pace](https://discuss.elastic.co/u/pace)
#### Post date: [June 1, 2017, 4:58am UTC](https://discuss.elastic.co/t/filebeats-err-connecting-error-publishing-events/87837/1 "2017-06-01T04:58:25Z")

</div>

Hey all,

So i seem to be getting an issue similar to others on here.

Filebeats is running and so is logstash

I can telnet to localhost:5044

```
Filebeat.yml

#----------------------------- Logstash output --------------------------------

    filebeat.prospectors:

# Each - is a prospector. Most options can be set at the prospector level, so
# you can use different prospectors for various configurations.
# Below are the prospector specific configurations.

- input_type: log

  # Paths that should be crawled and fetched. Glob based paths.
  paths:
    - /Users/blupace/Applications/logstash-tutorial2.log

#output.logstash:
  # The Logstash hosts
    hosts: ["localhost:5044"]

first-pipeline.conf

input {
    beats {
        host => "localhost"
        port => "5044"
    }
}
# The filter part of this file is commented out to indicate that it is
# optional.
# filter {
#
# }
output {
    stdout { codec => rubydebug }
}

```

**2017/06/01 04:57:03.285362 single.go:140: ERR Connecting error publishing events (retrying): Get [http://localhost:5044](http://localhost:5044): read tcp 127.0.0.1:58277-\>127.0.0.1:5044: read: connection reset by peer**

Im not sure why the connection keeps getting closed.  
Running logstash 5.4.0  
Running filebeat 5.4.0

Envioroment: Mac

---

<div class="post-metadata">

### Author: ![pace](https://avatars.discourse-cdn.com/v4/letter/p/c2a13f/32.png) [@pace](https://discuss.elastic.co/u/pace)
#### Post date: [June 1, 2017, 5:19am UTC](https://discuss.elastic.co/t/filebeats-err-connecting-error-publishing-events/87837/2 "2017-06-01T05:19:48Z")

</div>

OK so i figured this out, i needed to remove the comment before output.logstash:

```
#output.logstash:
  # The Logstash hosts
    hosts: ["localhost:5044"]
```

---

<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 29, 2017, 5:20am UTC](https://discuss.elastic.co/t/filebeats-err-connecting-error-publishing-events/87837/3 "2017-06-29T05:20:25Z")

</div>

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