From 38765136335531475d7a77e55c9c4132080d532e Mon Sep 17 00:00:00 2001 From: Denis Rechkunov Date: Wed, 16 Nov 2022 14:36:49 +0100 Subject: [PATCH] Fix error spam on AKS This was happening due to the error level logging when the log path matcher detected a `log.file.path` that does not start with a standard Docker container log folder `/var/lib/docker/containers` because AKS dropped support for Docker in September 2022 and switched to containerd. It looks like this message was not supposed to be on the error level in the first place since it just means that the matcher didn't match and it's not an error. But it was mistakenly promoted from the debug level in https://github.com/elastic/beats/pull/16866 most likely because the message started with `Error` and looked confusing. This a partial fix to unblock our customers, but we still need to come up with the full AKS/containerd support in a follow up change. --- filebeat/processor/add_kubernetes_metadata/matchers.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/filebeat/processor/add_kubernetes_metadata/matchers.go b/filebeat/processor/add_kubernetes_metadata/matchers.go index b455de98be5b..1ac064ac2d9a 100644 --- a/filebeat/processor/add_kubernetes_metadata/matchers.go +++ b/filebeat/processor/add_kubernetes_metadata/matchers.go @@ -92,7 +92,7 @@ func (f *LogPathMatcher) MetadataIndex(event mapstr.M) string { f.logger.Debugf("Incoming log.file.path value: %s", source) if !strings.Contains(source, f.LogsPath) { - f.logger.Errorf("Error extracting container id - source value does not contain matcher's logs_path '%s'.", f.LogsPath) + f.logger.Debugf("log.file.path value does not contain matcher's logs_path '%s', skipping...", f.LogsPath) return "" }