aws / event-ruler

Event Ruler is a Java library that allows matching many thousands of Events per second to any number of expressive and sophisticated rules.
Apache License 2.0
556 stars 58 forks source link

Anything-but wildcard support seems to still not work #152

Closed HackityAnn closed 3 months ago

HackityAnn commented 3 months ago

Describe the bug

Although it was merged here I am still getting an InvalidEventPatternException when trying to use wildcard with anything-but

To Reproduce

Try to create the eventrule with:

          "input": [
                {
                "anything-but": [
                    {"wildcard": "*\"AWS_STEP_FUNCTIONS_STARTED_BY_EXECUTION_ID\":*"}
                    ]
                }
            ]

Expected behavior

Would expect this to filter within the input field for anything-but my wildcard expression (in this case if it is a child of a step function)

Environment:

AWS eu-west-1

jonessha commented 3 months ago

It looks like the problem is you're using square brackets after the anything-but, whereas you should be using curly brackets. Like in the README example:

{
  "detail": {
    "state": [ { "anything-but": { "wildcard": "*/bin/*.jar" } } ]
  }
}

It also sounds like you might be looking for this functionality in AWS. Perhaps in EventBridge? Although we aim to deploy all new Ruler functionality in AWS, the time this takes varies based on service, and it is far from instantaneous today. If you're looking at EventBridge specifically, then anything-but-wildcard support may be available in a month or two, and we will publish a What's New post to indicate when it is available.

Closing this but please re-open if you still believe anything-but-wildcard is not working as expected.

HackityAnn commented 3 months ago

Ah you are right I am dumb sorry!

jonessha commented 3 months ago

Not at all, no worries!