From b017e506dc267b4383cdf370d113989913bd2abf Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Fri, 1 Sep 2023 20:02:11 +0200 Subject: [PATCH] Remove 'onFilteredOut' and 'onDroppedOnPublish' callback logs (#36399) (#36487) The 'onFilteredOut' and 'onDroppedOnPublish' callbacks debug logs can cause an infinity loop of log entries being logged over and over again when running under Elastic-Agent. Those log entries are removed to prevent this from happening in the future. The monitoring Filebeat uses a drop processor to drop its own logs, however if log level is debug the `onFilteredOut` callback debug log will log all dropped events, because it is done by the monitoring Filebeat, it will be picked up, dropped and logged again, creating this infinity loop. (cherry picked from commit dde4079b9162a10660d5a5ee86321fdbbf456139) Co-authored-by: Tiago Queiroz --- CHANGELOG.next.asciidoc | 1 + libbeat/publisher/pipeline/client.go | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/CHANGELOG.next.asciidoc b/CHANGELOG.next.asciidoc index bcbf64fa196..e611a11b3e9 100644 --- a/CHANGELOG.next.asciidoc +++ b/CHANGELOG.next.asciidoc @@ -101,6 +101,7 @@ https://github.com/elastic/beats/compare/v8.8.1\...main[Check the HEAD diff] - Remove erroneous error log in GCPPubSub input. {pull}36296[36296] - Fix Filebeat Cisco module with missing escape character {issue}36325[36325] {pull}36326[36326] - Fix panic when redact option is not provided to CEL input. {issue}36387[36387] {pull}36388[36388] +- Remove 'onFilteredOut' and 'onDroppedOnPublish' callback logs {issue}36299[36299] {pull}36399[36399] *Heartbeat* diff --git a/libbeat/publisher/pipeline/client.go b/libbeat/publisher/pipeline/client.go index b47380befb1..c566a07942f 100644 --- a/libbeat/publisher/pipeline/client.go +++ b/libbeat/publisher/pipeline/client.go @@ -203,12 +203,10 @@ func (c *client) onPublished() { } func (c *client) onFilteredOut(e beat.Event) { - c.logger.Debugf("Pipeline client receives callback 'onFilteredOut' for event: %+v", e) c.observer.filteredEvent() } func (c *client) onDroppedOnPublish(e beat.Event) { - c.logger.Debugf("Pipeline client receives callback 'onDroppedOnPublish' for event: %+v", e) c.observer.failedPublishEvent() if c.clientListener != nil { c.clientListener.DroppedOnPublish(e)