Skip to content

Instantly share code, notes, and snippets.

@andresriancho
Created November 8, 2019 18:47
Show Gist options
  • Save andresriancho/2a85070593d70f48430ea132e08c1ad9 to your computer and use it in GitHub Desktop.
Save andresriancho/2a85070593d70f48430ea132e08c1ad9 to your computer and use it in GitHub Desktop.
Athena query to get AWS S3 use
SELECT eventtime,
eventname,
requestparameters,
awsregion,
eventsource,
resources
FROM cloudtrail_662651605507
WHERE year = '2019'
AND month IN ('7', '8', '9', '10', '11')
AND eventsource = 's3.amazonaws.com'
AND eventname NOT IN ('GetBucketLogging', 'ListBuckets', 'GetBucketLocation', 'GetBucketPublicAccessBlock', 'GetBucketPolicyStatus', 'GetBucketAcl', 'GetAccountPublicAccessBlock', 'GetBucketCors', 'GetBucketWebsite', 'GetBucketRequestPayment', 'GetBucketPolicy');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment