简体   繁体   English

可以使用boto3获得S3存储桶使用的带宽吗?

[英]Possible to get bandwidth used by S3 bucket using boto3?

python中的boto3是否支持查询特定S3存储桶使用了多少带宽(以字节为单位)?

You can activate Amazon S3 Server Access Logging : 您可以激活Amazon S3服务器访问日志

To track requests for access to your bucket, you can enable server access logging . 要跟踪对存储桶的访问请求,可以启用服务器访问日志记录 Each access log record provides details about a single access request, such as the requester, bucket name, request time, request action, response status, and an error code, if relevant. 每个访问日志记录都提供有关单个访问请求的详细信息,例如请求者,存储桶名称,请求时间,请求操作,响应状态以及错误代码(如果有)。

The logs are output to Amazon S3 (there is a delay involved). 日志输出到Amazon S3(涉及延迟)。 You could then process the logs files using Python. 然后,您可以使用Python处理日志文件。 I like using Amazon Athena to run queries on the logs. 我喜欢使用Amazon Athena在日志上运行查询。

See: Analyze Access Logs Using Athena 请参阅: 使用Athena分析访问日志

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM