S3 列出更新的文件 [英] S3 list files newer than

查看:26
本文介绍了S3 列出更新的文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个 S3 存储桶和一个包含我们所有访问日志的目录.我想列出比特定时间/日期更新的文件.有什么办法可以实现吗?

We have an S3 bucket, and a directory with all our access logs. I would like to list files newer than a specific time/date. Any way this can be achieved?

该目录有超过 100,000 个文件,获取整个列表并遍历它们似乎效率低下.

The directory has over 100,000 files and it seems inefficient to fetch the entire list and iterate over them all.

提前致谢!

推荐答案

好的.将根据您迄今为止分享的内容做出一些假设.
如果这些是 ELB 生成的访问文件,则名称格式有一个结构,如此处所述 http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/access-log-collection.html

Okay. Going to make a couple of assumption made on what you've shared so far.
If these are the access files generated by ELB, there is a structure to the format of the name, as documented here http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/access-log-collection.html

如果这些不是 ELB 日志,我将使用 S3 生命周期策略解决此问题,如下所述:http://docs.aws.amazon.com/AmazonS3/latest/dev/object-lifecycle-mgmt.html
在这种情况下,早于您设置的持续时间的对象可能会过期(即删除或移动到冰川.

If these are not the ELB logs, the way I would solve this is with an S3 Lifecycle Policy, as described here: http://docs.aws.amazon.com/AmazonS3/latest/dev/object-lifecycle-mgmt.html
In this case objects older than the duration you set could be expired (i.e. deleted or moved to glacier.

这篇关于S3 列出更新的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆