From 71c1d9431fda098e1228d4b2148b369865749079 Mon Sep 17 00:00:00 2001 From: "Thibault \"bui\" Koechlin" Date: Wed, 2 Jun 2021 14:27:34 +0200 Subject: [PATCH] fix #823 : lower JsonExtract debug (#824) * lower key not found log level, fix #823 --- pkg/exprhelpers/jsonextract.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/exprhelpers/jsonextract.go b/pkg/exprhelpers/jsonextract.go index 8c60a50bda2..125dd217685 100644 --- a/pkg/exprhelpers/jsonextract.go +++ b/pkg/exprhelpers/jsonextract.go @@ -13,7 +13,12 @@ func JsonExtractLib(jsblob string, target ...string) string { jsonparser.StringToBytes(jsblob), target..., ) + if err != nil { + if err == jsonparser.KeyPathNotFoundError { + log.Debugf("%+v doesn't exist", target) + return "" + } log.Errorf("jsonExtractLib : %+v : %s", target, err) return "" } @@ -22,7 +27,6 @@ func JsonExtractLib(jsblob string, target ...string) string { return "" } strvalue := string(value) - //debug stuff return strvalue }