

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

# 了解 CloudTrail 日誌和 Athena 資料表
<a name="create-cloudtrail-table-understanding"></a>

開始建立資料表之前，您應該更深入了解 CloudTrail 及其如何存放資料。這可協助您建立所需資料表，不論您的建立方式是透過 CloudTrail 主控台或 Athena。

CloudTrail 將日誌以壓縮的 gzip 格式 (`*.json.gz`) 儲存在 JSON 文字檔案中。日誌檔案的位置取決於您設定追蹤的方式、您正在記錄的 AWS 區域 或 區域，以及其他因素。

如需有關日誌存放位置、JSON 結構、日誌檔案內容的詳細資訊，請參閱《[AWS CloudTrail 使用者指南](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-user-guide.html)》中的下列主題：
+  [尋找 CloudTrail 日誌檔案](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-find-log-files.html) 
+  [CloudTrail 日誌檔案範例](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-log-file-examples.html) 
+  [CloudTrail 記錄內容](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-event-reference-record-contents.html)
+  [CloudTrail 事件參考](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-event-reference.html) 

若要收集日誌並儲存到 Amazon S3 中，請從 AWS 管理主控台啟用 CloudTrail。如需詳細資訊，請參閱《AWS CloudTrail 使用者指南》**中的[建立追蹤](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-create-a-trail-using-the-console-first-time.html)。