0

I was tried querying our CloudFront logs using Athena for an error i'm getting but haven't received any results. The query i'm trying using is:

SELECT *

FROM cloudfront_logs

WHERE request_id =
> '-to3QjS9nkb5NDT9BQpAE1LYCz5QAMYUnQvrp_sJTSaxQNCPxoFYVqLw=='

I used:

CREATE EXTERNAL TABLE IF NOT EXISTS default.cloudfront_logs (
>   `date` DATE,
>   time STRING,
>   location STRING,
>   bytes BIGINT,
>   request_ip STRING,
>   method STRING,
>   host STRING,
>   uri STRING,
>   status INT,
>   referrer STRING,
>   user_agent STRING,
>   query_string STRING,
>   cookie STRING,
>   result_type STRING,
>   request_id STRING,
>   host_header STRING,
>   request_protocol STRING,
>   request_bytes BIGINT,
>   time_taken FLOAT,
>   xforwarded_for STRING,
>   ssl_protocol STRING,
>   ssl_cipher STRING,
>   response_result_type STRING,
>   http_version STRING,
>   fle_status STRING,
>   fle_encrypted_fields INT,
>   c_port INT,
>   time_to_first_byte FLOAT,
>   x_edge_detailed_result_type STRING,
>   sc_content_type STRING,
>   sc_content_len BIGINT,
>   sc_range_start BIGINT,
>   sc_range_end BIGINT
> )
> ROW FORMAT DELIMITED
> FIELDS TERMINATED BY '\t'
> LOCATION 's3://cloudfront-logs-site.s3.amazonaws.com/'
> TBLPROPERTIES ( 'skip.header.line.count'='2' )

to create the table. Could anyone advise what i should change? Its really appropriated.enter image description here

query output i received : enter image description here

2
  • Are you using Athena? Try a less general query, or browsing the table. Also the request ID you've given above in the text doesn't match the screenshot you provided.
    – Tim
    Oct 2, 2022 at 0:38
  • Yes im using Athena for the query , is there any suggestion for the table , i received query output as blank ! Oct 2, 2022 at 5:32

0

You must log in to answer this question.