diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc index 6a889c98952..21c8a7a400a 100644 --- a/CHANGELOG.asciidoc +++ b/CHANGELOG.asciidoc @@ -26,6 +26,7 @@ https://github.com/elastic/beats/compare/v1.1.0...master[Check the HEAD diff] ==== Bugfixes *Affecting all Beats* +- Fix logstash output loop hanging in infinite loop on too many output errors. *Packetbeat* diff --git a/libbeat/outputs/logstash/client.go b/libbeat/outputs/logstash/client.go index 3d263ef8027..022c2cd75b4 100644 --- a/libbeat/outputs/logstash/client.go +++ b/libbeat/outputs/logstash/client.go @@ -196,7 +196,8 @@ func (l *lumberjackClient) onFail(n int, err error) (int, error) { // if we've seen 3 consecutive timeout errors, close connection l.countTimeoutErr++ - if l.countTimeoutErr == maxAllowedTimeoutErr { + if l.countTimeoutErr >= maxAllowedTimeoutErr { + l.countTimeoutErr = 0 // reset error counter and close connection _ = l.Close() return n, err }