Created
February 18, 2020 23:44
-
-
Save matthew-harper/c6b9d2078732af8db46ec87d533f0667 to your computer and use it in GitHub Desktop.
filter_user_events
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def filter_user_events(event) -> bool: | |
is_match = match_user_agent(event['userAgent']) | |
is_read_only = match_readonly_event_name(event['eventName']) | |
is_ignored_event = match_ignored_events(event['eventName']) | |
is_in_event = 'invokedBy' in event['userIdentity'] and event['userIdentity']['invokedBy'] == 'AWS Internal' | |
status = is_match and not is_read_only and not is_ignored_event and not is_in_event | |
return status |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment