我正在尝试为存储在google云存储桶中的对象设置实时访问日志。谷歌指定的here访问日志每小时生成一次,不起作用。
我希望关于对象访问的类似信息(ip,下载量,client_os),但在实时。有没有办法在谷歌云平台上做到这一点?
如果使用实时日志通过另一个点路由流量会更好,我将非常感谢关于如何做到这一点以及使用什么工具的建议。最终,我希望在google data studio中可视化数据。
发布于 2019-04-18 10:08:25
不幸的是,谷歌存储仅提供以下gcp-storage metric
- 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我认为您需要存储桶对象的访问日志,例如图像、videos...etc。您也许可以尝试在您的存储桶前面使用Google Cloud CDN。因此您可以通过获取所需访问日志,并从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
}发布于 2019-04-18 18:08:03
云存储的日志类型有三种:
您可以在Google Cloud Platform Console > Activity Activity Stream中查看审计日志。
资源类型过滤器:
GCS bucket。
可以在Logs Viewer中找到更详细的日志版本。
如果您需要使用日志进行进一步分析,请参阅Google Cloud文档中提供的there are several options to do so。还有一些示例查询可以在data Studio中可视化数据。Check more custom queries for Data Studio here。
https://stackoverflow.com/questions/55738078
复制相似问题