From d53d648ccb66eae8879d53c9382912e26f1aa6d6 Mon Sep 17 00:00:00 2001 From: kaiyan-sheng Date: Thu, 29 Apr 2021 06:36:31 +0800 Subject: [PATCH] Fix s3 input when there is a blank line in the log file (#25357) * Fix s3 input when there is a blank line in the log file * add changelog (cherry picked from commit e8c73c4e773ef170d614e2b117862ecc7fed9574) --- CHANGELOG.next.asciidoc | 1 + x-pack/filebeat/input/awss3/collector.go | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.next.asciidoc b/CHANGELOG.next.asciidoc index 0e1aeec8868..1d5b7701aaf 100644 --- a/CHANGELOG.next.asciidoc +++ b/CHANGELOG.next.asciidoc @@ -265,6 +265,7 @@ https://github.com/elastic/beats/compare/v7.0.0-alpha2...master[Check the HEAD d - Fix IPtables Pipeline and Ubiquiti dashboard. {issue}24878[24878] {pull}24928[24928] - Strip Azure Eventhub connection string in debug logs. {pulll}25066[25066] - Change `checkpoint.source_object` from Long to Keyword. {issue}25124[25124] {pull}25145[25145] +- Fix s3 input when there is a blank line in the log file. {pull}25357[25357] - Fix Nginx module pipelines. {issue}19088[19088] {pull}24699[24699] *Heartbeat* diff --git a/x-pack/filebeat/input/awss3/collector.go b/x-pack/filebeat/input/awss3/collector.go index 1ace01df882..8f7bb152295 100644 --- a/x-pack/filebeat/input/awss3/collector.go +++ b/x-pack/filebeat/input/awss3/collector.go @@ -397,7 +397,7 @@ func (c *s3Collector) createEventsFromS3Info(svc s3iface.ClientAPI, info s3Info, } if log == "" { - break + continue } // create event per log line @@ -409,7 +409,6 @@ func (c *s3Collector) createEventsFromS3Info(svc s3iface.ClientAPI, info s3Info, return err } } - return nil } func (c *s3Collector) decodeJSON(decoder *json.Decoder, objectHash string, s3Info s3Info, s3Ctx *s3Context) error {