我尝试使用 Athena 查询我们的 CloudFront 日志,但出现错误,没有收到任何结果。我尝试使用的查询是:
SELECT *
FROM cloudfront_logs
WHERE request_id =
> '-to3QjS9nkb5NDT9BQpAE1LYCz5QAMYUnQvrp_sJTSaxQNCPxoFYVqLw=='
我用了:
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' )