From 5b59e43e202e36be3194b25b1c71ccb366e6ae97 Mon Sep 17 00:00:00 2001 From: "tsv.titan@gmail.com" Date: Fri, 20 Oct 2023 15:49:37 +0300 Subject: [PATCH] Fixed tags filtering --- plugins/processors/filter/filter.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/plugins/processors/filter/filter.go b/plugins/processors/filter/filter.go index effdc00811e38..79997e7ab1914 100644 --- a/plugins/processors/filter/filter.go +++ b/plugins/processors/filter/filter.go @@ -67,18 +67,19 @@ func (f *Filter) ifCondition(item *FilterIf, metric telegraf.Metric) bool { keys := f.getKeys(tags) flag := true - for k, r := range item.tags { + for k, v := range item.Tags { if !utils.Contains(keys, k) { - continue + return false } exists := false value := tags[k] + r := item.tags[k] if r != nil { exists = r.MatchString(value) } else { - exists = value == item.Tags[k] + exists = value == v } flag = flag && exists