diff --git a/CHANGELOG.next.asciidoc b/CHANGELOG.next.asciidoc index 46c084c1fd0..b843d3a1add 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* @@ -217,31 +218,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)