# After reboot EC2 instance, Filebeat cannot send log to logstash: ERROR	logstash/async.go:256	Failed to publish events caused by: write tcp 127.0.0.1:52242-\>127.0.0.1:5043: write: connection reset by peer

**URL:** https://discuss.elastic.co/t/after-reboot-ec2-instance-filebeat-cannot-send-log-to-logstash-error-logstash-async-go-256-failed-to-publish-events-caused-by-write-tcp-127-0-0-1-52242-127-0-0-1-write-connection-reset-by-peer/165648
**Category:** Beats
**Tags:** filebeat
**Created:** [January 24, 2019, 7:08pm UTC](https://discuss.elastic.co/t/after-reboot-ec2-instance-filebeat-cannot-send-log-to-logstash-error-logstash-async-go-256-failed-to-publish-events-caused-by-write-tcp-127-0-0-1-52242-127-0-0-1-write-connection-reset-by-peer/165648 "2019-01-24T19:08:32Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![fuwei1234](https://avatars.discourse-cdn.com/v4/letter/f/c67d28/32.png) [@fuwei1234](https://discuss.elastic.co/u/fuwei1234)
#### Post date: [January 24, 2019, 7:08pm UTC](https://discuss.elastic.co/t/after-reboot-ec2-instance-filebeat-cannot-send-log-to-logstash-error-logstash-async-go-256-failed-to-publish-events-caused-by-write-tcp-127-0-0-1-52242-127-0-0-1-write-connection-reset-by-peer/165648/1 "2019-01-24T19:08:32Z")

</div>

After I reboot EC2, filebeat can no longer send log to logstash, I change port from 5044 to 5043 and filebeat has this error.

| 019-01-24T19:01:48.060Z | INFO | pipeline/output.go:95 | Connecting to backoff(async(tcp://0.0.0.0:5043)) |
| --- | --- | --- | --- |
| 2019-01-24T19:01:48.060Z | INFO | pipeline/output.go:105 | Connection to backoff(async(tcp://0.0.0.0:5043)) established |
| 2019-01-24T19:01:48.093Z | ERROR | logstash/async.go:256 | Failed to publish events caused by: write tcp 127.0.0.1:52242-\>127.0.0.1:5043: write: connection reset by peer |

---

<div class="post-metadata">

### Author: ![steffens](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/steffens/32/79630_2.png) [@steffens](https://discuss.elastic.co/u/steffens)
#### Post date: [January 25, 2019, 12:19pm UTC](https://discuss.elastic.co/t/after-reboot-ec2-instance-filebeat-cannot-send-log-to-logstash-error-logstash-async-go-256-failed-to-publish-events-caused-by-write-tcp-127-0-0-1-52242-127-0-0-1-write-connection-reset-by-peer/165648/2 "2019-01-25T12:19:30Z")

</div>

Filebeat reconnects upon error and sends again. Filebeat sends the events until the events have been acked by Logstash.  
The `connection reset by peer` indicates that the remote logstash or server did close the connection. In this case filebeat will reconnect and send again.

---

<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: [February 22, 2019, 12:19pm UTC](https://discuss.elastic.co/t/after-reboot-ec2-instance-filebeat-cannot-send-log-to-logstash-error-logstash-async-go-256-failed-to-publish-events-caused-by-write-tcp-127-0-0-1-52242-127-0-0-1-write-connection-reset-by-peer/165648/3 "2019-02-22T12:19:32Z")

</div>

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