admin管理员组

文章数量:1245899

I'm trying to create an AWS EventBridge rule, and I need to filter out events based on detail.type.

Each of these rules works separately:

Rule 1: This successfully filters out "foo-v2" and "bar-v2":

"detail": {
  "type": [{
    "anything-but": ["foo-v2", "bar-v2"]
  }]
}

Rule 2:

This successfully filters out anything containing datasync:

"detail": {
  "type": [{
    "anything-but": {
      "wildcard": "*datasync*"
    }
  }]
}

I've tried just about every different combination of these two but was not able to get one that was successful, does anyone have any advice on how I can combine both of these into one rule.

I'm trying to create an AWS EventBridge rule, and I need to filter out events based on detail.type.

Each of these rules works separately:

Rule 1: This successfully filters out "foo-v2" and "bar-v2":

"detail": {
  "type": [{
    "anything-but": ["foo-v2", "bar-v2"]
  }]
}

Rule 2:

This successfully filters out anything containing datasync:

"detail": {
  "type": [{
    "anything-but": {
      "wildcard": "*datasync*"
    }
  }]
}

I've tried just about every different combination of these two but was not able to get one that was successful, does anyone have any advice on how I can combine both of these into one rule.

Share Improve this question asked Feb 15 at 4:00 terrablterrabl 9243 gold badges11 silver badges24 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

You can use anything-but with wildcard and evaluate a set of items in a list.

Try adding just the wildcards for one of the items like the following:

"detail": {
  "type": [{
    "anything-but": {"wildcard": ["foo-v2", "bar-v2", "*datasync*"]}
          }]
          }

Comparison operators for use in event patterns in Amazon EventBridge

本文标签: Why can39t I combine multiple anythingbut conditions in AWS EventBridge event patternsStack Overflow