You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: NR-469064 Implement exclude_matching_entities filter in nri-winservice (#221)
* feat: NR-469064 Implement exclude_matching_entities filter in nri-winservice
* added an example in sample config yml file
* added integration test
* changed vaiable name and method name test
returnnil, fmt.Errorf("failed to parse config: %s", err)
50
54
}
55
+
51
56
varm matcher.Matcher
52
-
ifval, ok:=c.FilterEntity["windowsService.name"]; ok {
53
-
m=matcher.New(val)
54
-
} else {
55
-
returnnil, fmt.Errorf("failed to parse config: only filter by windowsService.name is allowed")
57
+
varincludeFilters, excludeFilters []string
58
+
59
+
// Get include filters
60
+
ifval, ok:=c.IncludeEntity["windowsService.name"]; ok {
61
+
includeFilters=val
62
+
}
63
+
64
+
// Get exclude filters
65
+
ifval, ok:=c.ExcludeEntity["windowsService.name"]; ok {
66
+
excludeFilters=val
67
+
}
68
+
69
+
// Must have at least include filters (exclude-only is not supported)
70
+
iflen(includeFilters) ==0 {
71
+
returnnil, fmt.Errorf("failed to parse config: include_matching_entities is required for windowsService.name (exclude-only filtering is not supported)")
56
72
}
73
+
74
+
// Create matcher with both include and exclude filters
0 commit comments