Skip to content

Commit 1274afa

Browse files
author
Nitin Goel
committed
Fixing the issue with deletion of temp file along with the dynamic prefix changes
1 parent b56fdb3 commit 1274afa

File tree

1 file changed

+6
-1
lines changed
  • lib/logstash/outputs

1 file changed

+6
-1
lines changed

lib/logstash/outputs/s3.rb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -476,8 +476,13 @@ def reset_page_counter(key)
476476
private
477477
def delete_on_bucket(filename)
478478
bucket = @s3.buckets[@bucket]
479+
480+
first = Pathname.new @temporary_directory
481+
second = Pathname.new filename
479482

480-
remote_filename = "#{@prefix}#{File.basename(filename)}"
483+
remote_filename_path = second.relative_path_from first
484+
485+
remote_filename = remote_filename_path.to_s
481486

482487
@logger.debug("S3: delete file from bucket", :remote_filename => remote_filename, :bucket => @bucket)
483488

0 commit comments

Comments
 (0)