Skip to content

Commit a09b2c7

Browse files
Luke Swithenbankph
authored andcommitted
remove delete
Fixes #85
1 parent f7b75da commit a09b2c7

File tree

2 files changed

+4
-22
lines changed

2 files changed

+4
-22
lines changed

.ruby-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
jruby-1.7

lib/logstash/outputs/s3.rb

Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
# INFORMATION:
1414
#
1515
# This plugin batches and uploads logstash events into Amazon Simple Storage Service (Amazon S3).
16-
#
17-
# Requirements:
16+
#
17+
# Requirements:
1818
# * Amazon S3 Bucket and S3 Access Permissions (Typically access_key_id and secret_access_key)
1919
# * S3 PutObject permission
2020
# * Run logstash as superuser to establish connection
@@ -42,7 +42,7 @@
4242
# Both time_file and size_file settings can trigger a log "file rotation"
4343
# A log rotation pushes the current log "part" to s3 and deleted from local temporary storage.
4444
#
45-
## If you specify BOTH size_file and time_file then it will create file for each tag (if specified).
45+
## If you specify BOTH size_file and time_file then it will create file for each tag (if specified).
4646
## When EITHER time_file minutes have elapsed OR log file size > size_file, a log rotation is triggered.
4747
##
4848
## If you ONLY specify time_file but NOT file_size, one file for each tag (if specified) will be created..
@@ -258,7 +258,6 @@ def test_s3_write
258258

259259
begin
260260
write_on_bucket(test_filename)
261-
delete_on_bucket(test_filename)
262261
ensure
263262
File.delete(test_filename)
264263
end
@@ -466,24 +465,6 @@ def reset_page_counter
466465
@page_counter = 0
467466
end
468467

469-
private
470-
def delete_on_bucket(filename)
471-
bucket = @s3.buckets[@bucket]
472-
473-
remote_filename = "#{@prefix}#{File.basename(filename)}"
474-
475-
@logger.debug("S3: delete file from bucket", :remote_filename => remote_filename, :bucket => @bucket)
476-
477-
begin
478-
# prepare for write the file
479-
object = bucket.objects[remote_filename]
480-
object.delete
481-
rescue AWS::Errors::Base => e
482-
@logger.error("S3: AWS error", :error => e)
483-
raise LogStash::ConfigurationError, "AWS Configuration Error"
484-
end
485-
end
486-
487468
private
488469
def move_file_to_bucket_async(file)
489470
@logger.debug("S3: Sending the file to the upload queue.", :filename => File.basename(file))

0 commit comments

Comments
 (0)