diff --git a/CHANGELOG.next.asciidoc b/CHANGELOG.next.asciidoc index 854f8740435..6f47b840fe7 100644 --- a/CHANGELOG.next.asciidoc +++ b/CHANGELOG.next.asciidoc @@ -16,6 +16,7 @@ https://github.com/elastic/beats/compare/v8.2.0\...main[Check the HEAD diff] *Filebeat* +- Fixed error spam from `add_kubernetes_metadata` processor when running on AKS. {pull}33697[33697] *Heartbeat* @@ -218,31 +219,3 @@ https://github.com/elastic/beats/compare/v8.2.0\...main[Check the HEAD diff] *Functionbeat* ==== Known Issue - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/filebeat/processor/add_kubernetes_metadata/matchers.go b/filebeat/processor/add_kubernetes_metadata/matchers.go index b455de98be5..30d68c01cbc 100644 --- a/filebeat/processor/add_kubernetes_metadata/matchers.go +++ b/filebeat/processor/add_kubernetes_metadata/matchers.go @@ -62,7 +62,7 @@ func newLogsPathMatcher(cfg conf.C) (add_kubernetes_metadata.Matcher, error) { err := cfg.Unpack(&config) if err != nil || config.LogsPath == "" { - return nil, fmt.Errorf("fail to unpack the `logs_path` configuration: %s", err) + return nil, fmt.Errorf("fail to unpack the `logs_path` configuration: %w", err) } logPath := config.LogsPath @@ -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 "" } @@ -102,7 +102,7 @@ func (f *LogPathMatcher) MetadataIndex(event mapstr.M) string { if f.ResourceType == "pod" { // Pod resource type will extract only the pod UID, which offers less granularity of metadata when compared to the container ID if strings.Contains(source, ".log") && !strings.HasSuffix(source, ".gz") { - // Specify a pod resource type when writting logs into manually mounted log volume, + // Specify a pod resource type when writing logs into manually mounted log volume, // those logs apper under under "/var/lib/kubelet/pods//volumes/..." if strings.HasPrefix(f.LogsPath, podKubeletLogsPath()) { pathDirs := strings.Split(source, pathSeparator)