0
0

More than 1 year has passed since last update.

CloudTrail のログを Athena で検索

Last updated at Posted at 2022-06-21

CloudTrail でログを取得する設定を施す。
CloudTrail の「Event history (イベント履歴)」 をを選択して、「Athena テーブルを作成」 をクリック。CloudTrail のログを保存しているバケットを選択する。
Athena に行く。
上記により作成されたテーブル名(cloudtrail_logs_aws_cloudtrail_logs_xxxx のようになっているはず)を選択する。「テーブルをプレビュー」をクリックすると、10件表示される。SQL を適切に変更すれば、自分の知りたい情報を得ることができる。

(一例)
イベント名の数

SELECT COUNT(DISTINCT eventname) FROM "default"."cloudtrail_logs_aws_cloudtrail_logs_xxxx" AS "Number of eventnames";

イメージ作成

SELECT * FROM "default"."cloudtrail_logs_aws_cloudtrail_logs_xxxx" WHERE eventname = 'CreateImage';

(参考)
https://docs.aws.amazon.com/ja_jp/athena/latest/ug/cloudtrail-logs.html
(参考:AWS の Youtube ビデオ)
https://www.youtube.com/watch?v=xe2GSs1Tkyo
(SQL の参考)
https://aws.amazon.com/jp/premiumsupport/knowledge-center/athena-tables-search-cloudtrail-logs/?nc1=h_ls

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0