Skip to content

Commit

Permalink
fix crowdsecurity#823 : lower JsonExtract debug (crowdsecurity#824)
Browse files Browse the repository at this point in the history
* lower key not found log level, fix crowdsecurity#823
  • Loading branch information
buixor authored Jun 2, 2021
1 parent 7e81bdd commit 71c1d94
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/exprhelpers/jsonextract.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 ""
}
Expand All @@ -22,7 +27,6 @@ func JsonExtractLib(jsblob string, target ...string) string {
return ""
}
strvalue := string(value)
//debug stuff
return strvalue
}

Expand Down

0 comments on commit 71c1d94

Please sign in to comment.