fix
This commit is contained in:
parent
c8fee2a656
commit
97300548f7
1 changed files with 5 additions and 4 deletions
|
@ -75,15 +75,16 @@ func NewAlertContext(contextToSend []csconfig.ContextToSend, valueLength int) er
|
|||
}
|
||||
|
||||
for _, value := range values {
|
||||
valueCompiled, err := expr.Compile(value, exprhelpers.GetExprOptions(map[string]interface{}{"evt": &types.Event{}})...)
|
||||
if err != nil {
|
||||
return fmt.Errorf("compilation of '%s' context value failed: %v", value, err)
|
||||
}
|
||||
if slices.Contains(alertContext.ContextToSend[key], value) {
|
||||
log.Debugf("value '%s' from '%s' already in context", value, ctx.SourceFile)
|
||||
continue
|
||||
}
|
||||
|
||||
valueCompiled, err := expr.Compile(value, exprhelpers.GetExprOptions(map[string]interface{}{"evt": &types.Event{}})...)
|
||||
if err != nil {
|
||||
return fmt.Errorf("compilation of '%s' context value failed: %v", value, err)
|
||||
}
|
||||
|
||||
alertContext.ContextToSendCompiled[key] = append(alertContext.ContextToSendCompiled[key], valueCompiled)
|
||||
alertContext.ContextToSend[key] = append(alertContext.ContextToSend[key], value)
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue