Skip to content

Commit

Permalink
Fix error spam on AKS
Browse files Browse the repository at this point in the history
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 elastic#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.
  • Loading branch information
rdner committed Nov 16, 2022
1 parent a5ffacc commit 3876513
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion filebeat/processor/add_kubernetes_metadata/matchers.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 ""
}

Expand Down

0 comments on commit 3876513

Please sign in to comment.