From 66d53ccc08eb420c0384d643764bd4b7c390063b Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Mon, 7 Oct 2024 08:08:30 -0600 Subject: [PATCH] [8.15](backport #41071) Missing backup and delete for AWS S3 polling mode (#41122) * Missing backup and delete for AWS S3 polling mode (#41071) (cherry picked from commit f47cbd61321464f07f3edc678b4bc4b7d6f1d5e1) --------- Co-authored-by: kaiyan-sheng --- CHANGELOG.next.asciidoc | 1 + x-pack/filebeat/input/awss3/s3_input.go | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/CHANGELOG.next.asciidoc b/CHANGELOG.next.asciidoc index 05a1e91cdbc..dd8cb69de40 100644 --- a/CHANGELOG.next.asciidoc +++ b/CHANGELOG.next.asciidoc @@ -97,6 +97,7 @@ https://github.com/elastic/beats/compare/v8.8.1\...main[Check the HEAD diff] - Prevent GCP Pub/Sub input blockage by increasing default value of `max_outstanding_messages` {issue}35029[35029] {pull}38985[38985] - Updated Websocket input title to align with existing inputs {pull}39006[39006] - Fix replace processor handling of zero string replacement validation. {pull}40751[40751] +- Add backup and delete for AWS S3 polling mode feature back. {pull}41071[41071] *Heartbeat* diff --git a/x-pack/filebeat/input/awss3/s3_input.go b/x-pack/filebeat/input/awss3/s3_input.go index 999b27da534..bd1e8f7700e 100644 --- a/x-pack/filebeat/input/awss3/s3_input.go +++ b/x-pack/filebeat/input/awss3/s3_input.go @@ -172,6 +172,10 @@ func (in *s3PollerInput) workerLoop(ctx context.Context, workChan <-chan *s3Fetc // Metrics in.metrics.s3ObjectsAckedTotal.Inc() + + if finalizeErr := objHandler.FinalizeS3Object(); finalizeErr != nil { + in.log.Errorf("failed finalizing objects from S3 bucket (manual cleanup is required): %w", finalizeErr) + } } }