From e8c73c4e773ef170d614e2b117862ecc7fed9574 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 --- 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 ad25a484fba..554e207e415 100644 --- a/CHANGELOG.next.asciidoc +++ b/CHANGELOG.next.asciidoc @@ -388,6 +388,7 @@ https://github.com/elastic/beats/compare/v7.0.0-alpha2...master[Check the HEAD d - Updating Oauth2 flow for m365_defender fileset. {pull}24829[24829] - Fix IPtables Pipeline and Ubiquiti dashboard. {issue}24878[24878] {pull}24928[24928] - 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 d86220faf7d..ecc381abf73 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 {