aws cloudfront 中的其他设备类型列,例如 CloudFront-Is-Mobile-Viewer

Additional Device type columns like CloudFront-Is-Mobile-Viewer in aws cloudfront

如何使用 CloudFront-Is-Mobile-Viewer、CloudFront-Is-Desktop-Viewer 或 CloudFront-Is-Tablet-Viewer 等其他设备类型列配置 aws cloudfront 分发日志。

我在 S3 中有像图像这样的静态对象,这些都在云端复制。访问日志根据 AWS Configuring and Using Access logs of cloudfront 填充到 cloudfront Distribution 日志中。我想要 cloudfront Distribution 日志中的其他列,其中填充了 Desktop 、 mobile 、 Tablet 等设备类型。

我想知道完成此操作所需的确切步骤。

CloudFront 不在访问日志中提供这些列。

但是,这些值 are derived from 存在于日志文件的 cs(User-Agent) 列中的值。

处理日志时,您需要自己导出它们。无法配置 CloudFront 来记录它们。日志格式不支持自定义

在网络上搜索您选择的脚本语言的用户代理解析库。

Random example.