在 AWS Athena 中转换 AWS WAF 时间戳的查询
Query to convert AWS WAF timestamp in AWS Athena
如何查询AWS WAF日志时间戳从Unix时间戳到正常时间?
您可以简单地通过以下语法将其转换为日期时间
select
DATE(timestamp),
....
您可以使用from_unixtime
将unix纪元格式转换为时间戳格式。参考下面的示例和输出:
select from_unixtime(1594279112675/1000)
2020-07-09 07:18:32.000
在您的情况下,查询应如下所示:
select from_unixtime(timestamp/1000)
如何查询AWS WAF日志时间戳从Unix时间戳到正常时间?
您可以简单地通过以下语法将其转换为日期时间
select
DATE(timestamp),
....
您可以使用from_unixtime
将unix纪元格式转换为时间戳格式。参考下面的示例和输出:
select from_unixtime(1594279112675/1000)
2020-07-09 07:18:32.000
在您的情况下,查询应如下所示:
select from_unixtime(timestamp/1000)