-
-
Notifications
You must be signed in to change notification settings - Fork 21
Open
Description
I hit an issue today with this rule:
Because one of the matchers is :
filter_optional_null:
Image: null
This matcher hits the 'default' case in this switch statement:
func (rule *RuleEvaluator) getMatcherValues(ctx context.Context, matcher sigma.FieldMatcher) ([]string, error) {
matcherValues := []string{}
for _, abstractValue := range matcher.Values {
value := ""
switch abstractValue := abstractValue.(type) {
case string:
value = abstractValue
case int, float32, float64, bool:
value = fmt.Sprintf("%v", abstractValue)
default:
return nil, fmt.Errorf("expected scalar field matching value got: %v (%T)", abstractValue, abstractValue)
}
Here's my code:
eventmap := match.Event
ctx := ctx.Background()
result, err := rule_evaluator.Matches(ctx, eventmap)
if err != nil {
fmt.Printf("** ERROR evaluating match with ID [%v], err %v\n", match.MatchId, err)
...
Here's what the error returned from rule_evaluator.Matches:
** ERROR evaluating match with ID [30], err error evaluating search filter_optional_null: expected scalar field matching value got: <nil> (<nil>)
Metadata
Metadata
Assignees
Labels
No labels