From 9bfbff8e065b1d5b87ea62c07fd64a4aedf0efef Mon Sep 17 00:00:00 2001 From: erenJag Date: Wed, 8 Jul 2020 18:06:29 +0200 Subject: [PATCH] code improve --- pkg/parser/node.go | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/pkg/parser/node.go b/pkg/parser/node.go index 51b55d33f..157da54b7 100644 --- a/pkg/parser/node.go +++ b/pkg/parser/node.go @@ -304,20 +304,13 @@ func (n *Node) process(p *types.Event, ctx UnixParserCtx) (bool, error) { if n.Name != "" { NodesHitsOk.With(prometheus.Labels{"source": p.Line.Src, "name": n.Name}).Inc() } - if hasWhitelist && isWhitelisted && len(n.Statics) > 0 { + if hasWhitelist && isWhitelisted && len(n.Statics) > 0 || len(n.Statics) > 0 && !hasWhitelist { clog.Debugf("+ Processing %d statics", len(n.Statics)) // if all else is good in whitelist, process node's statics err := ProcessStatics(n.Statics, p, clog) if err != nil { clog.Fatalf("Failed to process statics : %v", err) } - } else if len(n.Statics) > 0 && !hasWhitelist { - clog.Debugf("+ Processing %d statics", len(n.Statics)) - // if all else is good, process node's statics - err := ProcessStatics(n.Statics, p, clog) - if err != nil { - clog.Fatalf("Failed to process statics : %v", err) - } } else { clog.Tracef("! No node statics") }