Read VPC flow logs on S3 bucket with Athena

0

I'm trying to use Athena to generate queries from VPC flow logs stored in an S3 bucket. I followed the guideline of "Querying Amazon VPC flow logs"[1], and I tried to access by both folders and files.

However, the generated queries were empty, with only title and no contents. I double checked that the files are not empty, and that the path is correct. I also tried to create partitions, but the results were unreadable.

Is there a way to access the contents of the S3 bucket? Thank you!

Enter image description here Enter image description here Enter image description here

已提问 1 年前577 查看次数
1 回答
1
已接受的回答

This article has generic info applicable to VPC Flow Logs, especially about partiioning and querying - https://www.linkedin.com/pulse/using-athena-partition-projection-query-cloudtrail-other-kinsman/.

It's hard to be sure from the image you pasted, but it looks like you've both set LOCATION to a specific date "2023/03/01/" and partitioned by date? That doesn't look right.

What query did you try?

专家
已回答 1 年前
  • I tired both "s3://.../2023/" and "s3://.../2023/03/01/". They return the same results. I just did it again and I'll add the screenshot in the original post.

    I tried the "ALTER TABLE vpc_flow_logs ADD PARTITION (date='YYYY-MM-dd') LOCATION ..." query but the results were unreadable.

    I'm trying out the LinkedIn article right now.

    Thanks!

  • Should have used s3://.../{location}/

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则