Skip to content

Commit

Permalink
script to download logs from s3
Browse files Browse the repository at this point in the history
  • Loading branch information
Craig Brozefsky committed Mar 26, 2010
1 parent 2cd82ca commit 571c067
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions vm/release-logs-s3
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/usr/bin/env ruby

require 'rubygems'
require 'aws/s3'


AWS::S3::Base.establish_connection!(
:access_key_id => ENV['AMAZON_ACCESS_KEY_ID'],
:secret_access_key => ENV['AMAZON_SECRET_ACCESS_KEY']
)


FLINT_BUCKET='matasano_flint'
begin
bucket = AWS::S3::Bucket.find(FLINT_BUCKET)
rescue AWS::S3::NoSuchBucket
bucket = AWS::S3::Bucket.create(FLINT_BUCKET)
end

AWS::S3::Bucket.enable_logging_for(FLINT_BUCKET)

bucket.logs.each {|l|
l.lines.each {|line|
if ( line.operation == 'REST.GET.OBJECT' and
line.http_status == 200 )
puts line
end
}
}

0 comments on commit 571c067

Please sign in to comment.