By using AWS re:Post, you agree to the Terms of Use

Questions tagged with Amazon Athena

Sort by most recent

Browse through the questions and answers listed below or filter and sort to narrow down your results.

Query JSON files from S3 with Athena

Hello, Can someone please help? I set up a trail to audit all TLS calls in the account and saved all logs in S3. I tried to query the logs from S3 with Athena. This is the query I created: ``` CREATE EXTERNAL TABLE cloudtrail_logs_tls_calls ( eventVersion STRING, userIdentity STRUCT< type: STRING, principalId: STRING, arn: STRING, accountId: STRING, accessKeyId: STRING, sessionContext: STRUCT< sessionIssuer: STRUCT< type: STRING, principalId: STRING, arn: STRING, accountId: STRING, userName: STRING>>>, eventTime STRING, eventSource STRING, eventName STRING, awsRegion STRING, sourceIpAddress STRING, userAgent STRING, requestParameters STRUCT< maxResults: STRING>, responseElements STRING, requestId STRING, eventId STRING, eventType STRING, managementEvent STRING, recipientAccountId STRING, eventCategory STRING, tlsDetails STRUCT< tlsVersion: STRING, cipherSuite: STRING, clientProvidedHostHeader: STRING> ) COMMENT 'CloudTrail table for <bucket_name> bucket' ROW FORMAT SERDE '' STORED AS INPUTFORMAT '' OUTPUTFORMAT '' LOCATION 's3://<bucket_name>/AWSLogs/<Acccount_Number>/CloudTrail/' TBLPROPERTIES ('classification'='cloudtrail'); ``` Then, when preview the table. I get this error: ![Enter image description here](/media/postImages/original/IMqzXKwK03SCufTBjRPK_6-Q) Thank you in advance for help,
asked 20 days ago