首页 > 解决方案 > 如何在谷歌云存储中启用实时对象访问分析?

问题描述

我正在尝试为存储在谷歌云存储桶中的对象设置实时访问日志。google在此处指定的访问日志每小时生成一次,并且不起作用。

我想要关于对象访问(ip、下载量、client_os)但实时的类似信息。有没有办法在谷歌云平台上做到这一点?

如果使用实时日志将流量路由到另一个点会更好,我将不胜感激有关如何做到这一点以及使用什么工具的建议。最终,我希望在谷歌数据工作室中可视化数据。

标签: google-analyticsgoogle-cloud-platformgoogle-cloud-storage

解决方案


不幸的是,谷歌存储仅提供以下gcp-storage 指标

- api/request_count
- authz/acl_based_object_access_count
- authz/object_specific_acl_mutation_count
- network/received_bytes_count
- network/sent_bytes_count
- storage/object_count
- storage/total_byte_seconds
- storage/total_bytes

我认为您想要访问存储桶对象的日志,例如图像、视频……等。您也许可以尝试在您的存储桶前使用Google Cloud CDN。因此,您可以通过httpRequest获取所需的访问日志,并从 stackdriver 获取

{
  "requestMethod": string,
  "requestUrl": string,
  "requestSize": string,
  "status": number,
  "responseSize": string,
  "userAgent": string,
  "remoteIp": string,
  "serverIp": string,
  "referer": string,
  "latency": string,
  "cacheLookup": boolean,
  "cacheHit": boolean,
  "cacheValidatedWithOriginServer": boolean,
  "cacheFillBytes": string,
  "protocol": string
}

推荐阅读