# Filebeat error failed to publish events caused connection reset by peer

**URL:** <https://discuss.elastic.co/t/filebeat-error-failed-to-publish-events-caused-connection-reset-by-peer/268400>\
**Category:** Beats\
**Tags:** filebeat\
**Created:** [March 25, 2021, 6:07pm UTC](https://discuss.elastic.co/t/filebeat-error-failed-to-publish-events-caused-connection-reset-by-peer/268400 "2021-03-25T18:07:31Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![aneeshansari](https://avatars.discourse-cdn.com/v4/letter/a/ac8455/32.png) [@aneeshansari](https://discuss.elastic.co/u/aneeshansari)\
**Post date:** [March 25, 2021, 6:07pm UTC](https://discuss.elastic.co/t/filebeat-error-failed-to-publish-events-caused-connection-reset-by-peer/268400/1 "2021-03-25T18:07:31Z")

</div>

Hello Everyone,

Need help for following error in filebeat with logstash.

error failed to publish events caused by: write tcp 127.0.0.1:random\_port-\>127.0.0.1:5044 write: connection reset by peer

I already increased client\_inactivity\_timeout =\> 60 seconds. but still getting same error after some time.

input {  
beats {  
port =\> 5044  
client\_inactivity\_timeout =\> 60  
}  
}

pls suggest to fix it permanently.

Thanks in advance...

---

<div class="post-metadata">

**Author:** ![ChrsMark](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/chrsmark/32/55858_2.png) [@ChrsMark](https://discuss.elastic.co/u/ChrsMark)\
**Post date:** [March 26, 2021, 8:10am UTC](https://discuss.elastic.co/t/filebeat-error-failed-to-publish-events-caused-connection-reset-by-peer/268400/2 "2021-03-26T08:10:50Z")

</div>

Hi!

Does the error gets fixed after some retries or Filebeat completely stops sending?  
It should be a network issue, but Filebeat will retry to send the failed batch so you will not lose any data if it is able to recover.

C.

---

<div class="post-metadata">

**Author:** ![aneeshansari](https://avatars.discourse-cdn.com/v4/letter/a/ac8455/32.png) [@aneeshansari](https://discuss.elastic.co/u/aneeshansari)\
**Post date:** [March 27, 2021, 4:05pm UTC](https://discuss.elastic.co/t/filebeat-error-failed-to-publish-events-caused-connection-reset-by-peer/268400/3 "2021-03-27T16:05:05Z")

</div>

> [@ChrsMark](#):
>
> sending

Thanks for reply.  
Filebeat is sending logs but, i continuously i can see this error. is there there any configurations will i have to make in filebeat or logstash ??

---

<div class="post-metadata">

**Author:** ![ChrsMark](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/chrsmark/32/55858_2.png) [@ChrsMark](https://discuss.elastic.co/u/ChrsMark)\
**Post date:** [March 29, 2021, 8:25am UTC](https://discuss.elastic.co/t/filebeat-error-failed-to-publish-events-caused-connection-reset-by-peer/268400/4 "2021-03-29T08:25:44Z")

</div>

Hi!

Maybe this can be of help: [Publishing to Logstash fails with "connection reset by peer" message | Filebeat Reference [7.12] | Elastic](https://www.elastic.co/guide/en/beats/filebeat/current/publishing-ls-fails-connection-reset-by-peer.html)

---

<div class="post-metadata">

**Author:** ![aneeshansari](https://avatars.discourse-cdn.com/v4/letter/a/ac8455/32.png) [@aneeshansari](https://discuss.elastic.co/u/aneeshansari)\
**Post date:** [March 29, 2021, 5:55pm UTC](https://discuss.elastic.co/t/filebeat-error-failed-to-publish-events-caused-connection-reset-by-peer/268400/5 "2021-03-29T17:55:59Z")

</div>

Thank You Chris,  
can you please suggest example or demo configuration here for ttl or anythig else to fix this issue, firewall is not a issue because filebeat and logstash is in same server.

pls let me know where i need to keep the configuration that you are sending it to me ?

Thanks in advance

---

<div class="post-metadata">

**Author:** ![ChrsMark](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/chrsmark/32/55858_2.png) [@ChrsMark](https://discuss.elastic.co/u/ChrsMark)\
**Post date:** [March 30, 2021, 7:31am UTC](https://discuss.elastic.co/t/filebeat-error-failed-to-publish-events-caused-connection-reset-by-peer/268400/6 "2021-03-30T07:31:26Z")

</div>

Hi!

It should be in the output configuration as docs indicate: [Configure the Logstash output | Filebeat Reference [7.12] | Elastic](https://www.elastic.co/guide/en/beats/filebeat/current/logstash-output.html#_configuration_options_18)

Foe example:

```auto
output.logstash:
  hosts: ["127.0.0.1:5044"]
  ttl: 120

```

---

<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:** [April 27, 2021, 9:31am UTC](https://discuss.elastic.co/t/filebeat-error-failed-to-publish-events-caused-connection-reset-by-peer/268400/7 "2021-04-27T09:31:31Z")

</div>

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