if profile is in debug, log debug even if it matched the profile (#894)
This commit is contained in:
parent
25ed1c265d
commit
05ac3ca402
|
@ -84,8 +84,12 @@ PROFILE_LOOP:
|
||||||
log.Warningf("failed to run whitelist expr : %v", err)
|
log.Warningf("failed to run whitelist expr : %v", err)
|
||||||
return nil, errors.Wrapf(err, "while running expression %s", profile.Filters[eIdx])
|
return nil, errors.Wrapf(err, "while running expression %s", profile.Filters[eIdx])
|
||||||
}
|
}
|
||||||
|
|
||||||
switch out := output.(type) {
|
switch out := output.(type) {
|
||||||
case bool:
|
case bool:
|
||||||
|
if profile.Debug != nil && *profile.Debug {
|
||||||
|
profile.DebugFilters[eIdx].Run(clog, out, exprhelpers.GetExprEnv(map[string]interface{}{"Alert": Alert}))
|
||||||
|
}
|
||||||
if out {
|
if out {
|
||||||
matched = true
|
matched = true
|
||||||
/*the expression matched, create the associated decision*/
|
/*the expression matched, create the associated decision*/
|
||||||
|
@ -96,9 +100,6 @@ PROFILE_LOOP:
|
||||||
|
|
||||||
decisions = append(decisions, subdecisions...)
|
decisions = append(decisions, subdecisions...)
|
||||||
} else {
|
} else {
|
||||||
if profile.Debug != nil && *profile.Debug {
|
|
||||||
profile.DebugFilters[eIdx].Run(clog, false, exprhelpers.GetExprEnv(map[string]interface{}{"Alert": Alert}))
|
|
||||||
}
|
|
||||||
log.Debugf("Profile %s filter is unsuccessful", profile.Name)
|
log.Debugf("Profile %s filter is unsuccessful", profile.Name)
|
||||||
if profile.OnFailure == "break" {
|
if profile.OnFailure == "break" {
|
||||||
break PROFILE_LOOP
|
break PROFILE_LOOP
|
||||||
|
|
Loading…
Reference in a new issue