recommended way of filtering results of keys in s3 bucket

705 views
Skip to first unread message

Erik Blas

unread,
Dec 6, 2011, 11:30:25 PM12/6/11
to boto-...@googlegroups.com
bucket.list doesn't seem to have a way to filter the results returned, or a sort for that matter. I'm trying to filter a result set from a bucket full of cloudfront log files. Advice on best way to get just the latest hour's file without iterating across the entire key listing?

Mitchell Garnaat

unread,
Dec 7, 2011, 7:06:37 AM12/7/11
to boto-...@googlegroups.com
Hi -

The only server-side mechanism available for filtering listings is the prefix & delimiter parameters.  If the log files are named in such a way that you can construct a prefix/delimiter pattern that will match all of the desired results, then you are golden.  If not, then you have to resort to client-side filtering which sucks for buckets with lots of keys.

Mitch

On Tue, Dec 6, 2011 at 11:30 PM, Erik Blas <erik...@gmail.com> wrote:
bucket.list doesn't seem to have a way to filter the results returned, or a sort for that matter. I'm trying to filter a result set from a bucket full of cloudfront log files. Advice on best way to get just the latest hour's file without iterating across the entire key listing?

--
You received this message because you are subscribed to the Google Groups "boto-users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/boto-users/-/Wh259l8ZToEJ.
To post to this group, send email to boto-...@googlegroups.com.
To unsubscribe from this group, send email to boto-users+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/boto-users?hl=en.

Erik Blas

unread,
Dec 8, 2011, 7:03:18 PM12/8/11
to boto-...@googlegroups.com
Thanks for the reply. Aye, after a bit of rereading the docs I found out about using the prefix. CloudFront logs written to a bucket can easily be filtered up to the hour with the prefix filtering luckily enough. 
Reply all
Reply to author
Forward
0 new messages