ablog

不器用で落着きのない技術者のメモ

Athena で CloudTrail から S3 イベントを集計する

クエリ

select eventname, count(1) cnt from cloudtrail_logs
where eventsource = 's3.amazonaws.com' 
group by eventname
order by cnt desc

実行結果

eventname count
ListObjects 263702
PutObject 200075
GetObject 134911
HeadObject 83034
UploadPartCopy 24569
HeadBucket 11849
CopyObject 2492
CreateMultipartUpload 1903
CompleteMultipartUpload 1870
DeleteObject 1855
GetBucketPublicAccessBlock 207
GetBucketAcl 204
ListBuckets 200
UploadPart 198
GetAccountPublicAccessBlock 194
GetBucketPolicyStatus 191
GetBucketEncryption 180
SelectObjectContent 137
GetBucketVersioning 33
REST.GET.OBJECT_LOCK_CONFIGURATION 21
GetBucketWebsite 19
GetBucketPolicy 18
ListObjectVersions 16
DeleteObjects 15
GetBucketTagging 15
GetObjectAcl 14
CreateBucket 13
GetBucketCors 13
GetBucketLocation 12
GetBucketLogging 9
GetBucketNotification 9
GetBucketLifecycle 9
GetBucketRequestPayment 9
GetBucketReplication 9
DeleteBucket 4
PutBucketPublicAccessBlock 2
PutBucketPolicy 1
PutBucketEncryption 1
GetObjectTagging 1