diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc index 43e286b3788..9cde2b1fde8 100644 --- a/CHANGELOG.asciidoc +++ b/CHANGELOG.asciidoc @@ -54,6 +54,7 @@ https://github.com/elastic/beats/compare/v7.0.0-alpha2...master[Check the HEAD d - Enforce validation for the Central Management access token. {issue}9621[9621] - Allow to unenroll a Beat from the UI. {issue}9452[9452] +- Fix exclude_labels when there are dotted keys {pull}10154[10154] *Auditbeat* diff --git a/libbeat/common/kubernetes/metadata.go b/libbeat/common/kubernetes/metadata.go index 391d617a8f9..d9698daad99 100644 --- a/libbeat/common/kubernetes/metadata.go +++ b/libbeat/common/kubernetes/metadata.go @@ -87,7 +87,7 @@ func (g *metaGenerator) ResourceMetadata(obj Resource) common.MapStr { // Exclude any labels that are present in the exclude_labels config for _, label := range g.ExcludeLabels { - delete(labelMap, label) + labelMap.Delete(label) } annotationsMap := generateMapSubset(objMeta.Annotations, g.IncludeAnnotations, g.AnnotationsDedot)