From eae57f95df941ea61a5b51a9c2253133c58cc8f2 Mon Sep 17 00:00:00 2001 From: Tiago Queiroz Date: Thu, 1 Feb 2024 14:54:47 +0100 Subject: [PATCH] Lower logging level when unpacking config in autodiscover (#37816) When unpacking a config while applying the autodiscover config template, sometimes a configuration template cannot be resolved at that moment but will be resolved at a later stage. This commit brings the logging level of this error back to debug as it can become too verbose and not always means the config is invalid. --- CHANGELOG.next.asciidoc | 1 + libbeat/autodiscover/template/config.go | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.next.asciidoc b/CHANGELOG.next.asciidoc index 579890f20293..48d87b1dd86f 100644 --- a/CHANGELOG.next.asciidoc +++ b/CHANGELOG.next.asciidoc @@ -57,6 +57,7 @@ https://github.com/elastic/beats/compare/v8.8.1\...main[Check the HEAD diff] - Support Elastic Agent control protocol chunking support {pull}37343[37343] - Upgrade elastic-agent-libs to v0.7.5. Removes obsolete "Treating the CommonName field on X.509 certificates as a host name..." deprecation warning for 8.0. {pull}37755[37755] - aws: Add credential caching for `AssumeRole` session tokens. {issue}37787[37787] +- Lower logging level to debug when attempting to configure beats with unknown fields from autodiscovered events/environments {pull}[37816][37816] *Auditbeat* diff --git a/libbeat/autodiscover/template/config.go b/libbeat/autodiscover/template/config.go index 3ba0db210de9..c050ff8acd86 100644 --- a/libbeat/autodiscover/template/config.go +++ b/libbeat/autodiscover/template/config.go @@ -154,7 +154,7 @@ func ApplyConfigTemplate(event bus.Event, configs []*conf.C, options ...ucfg.Opt var unpacked map[string]interface{} err = c.Unpack(&unpacked, opts...) if err != nil { - logp.Warn("autodiscover: Configuration template cannot be resolved: %v", err) + logp.Debug("autodiscover", "Configuration template cannot be resolved: %v", err) continue } // Repack again: