diff --git a/cmd/crowdsec-cli/lapi.go b/cmd/crowdsec-cli/lapi.go index b0a2fd78a..f1b2423ff 100644 --- a/cmd/crowdsec-cli/lapi.go +++ b/cmd/crowdsec-cli/lapi.go @@ -218,6 +218,10 @@ func NewLapiCmd() *cobra.Command { } func AddContext(key string, values []string, targetFile string) error { + if err := exprhelpers.Init(nil); err != nil { + return fmt.Errorf(err.Error()) + } + if err := alertcontext.ValidateContextExpr(key, values); err != nil { return fmt.Errorf("invalid context configuration :%s", err) } diff --git a/cmd/crowdsec-cli/utils.go b/cmd/crowdsec-cli/utils.go index 51344b69e..d6ea07548 100644 --- a/cmd/crowdsec-cli/utils.go +++ b/cmd/crowdsec-cli/utils.go @@ -758,7 +758,5 @@ func isFilePathInFolder(folderpath string, targetFilepath string) (bool, error) if err != nil { return false, err } - log.Infof("F: %+v | T: %+v", folderpath, targetFilepath) - log.Infof("REAL POATH: %+v", relPath) return !strings.Contains(relPath, ".."), nil }