|
13 | 13 | # INFORMATION: |
14 | 14 | # |
15 | 15 | # This plugin batches and uploads logstash events into Amazon Simple Storage Service (Amazon S3). |
16 | | -# |
17 | | -# Requirements: |
| 16 | +# |
| 17 | +# Requirements: |
18 | 18 | # * Amazon S3 Bucket and S3 Access Permissions (Typically access_key_id and secret_access_key) |
19 | 19 | # * S3 PutObject permission |
20 | 20 | # * Run logstash as superuser to establish connection |
|
42 | 42 | # Both time_file and size_file settings can trigger a log "file rotation" |
43 | 43 | # A log rotation pushes the current log "part" to s3 and deleted from local temporary storage. |
44 | 44 | # |
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). |
46 | 46 | ## When EITHER time_file minutes have elapsed OR log file size > size_file, a log rotation is triggered. |
47 | 47 | ## |
48 | 48 | ## 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 |
258 | 258 |
|
259 | 259 | begin |
260 | 260 | write_on_bucket(test_filename) |
261 | | - delete_on_bucket(test_filename) |
262 | 261 | ensure |
263 | 262 | File.delete(test_filename) |
264 | 263 | end |
@@ -466,24 +465,6 @@ def reset_page_counter |
466 | 465 | @page_counter = 0 |
467 | 466 | end |
468 | 467 |
|
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 | | - |
487 | 468 | private |
488 | 469 | def move_file_to_bucket_async(file) |
489 | 470 | @logger.debug("S3: Sending the file to the upload queue.", :filename => File.basename(file)) |
|
0 commit comments