Skip to content

Commit b6d430d

Browse files
nigoelelyscape
authored andcommitted
Fixing the issue with deletion of temp file along with the dynamic prefix changes
1 parent 95bf768 commit b6d430d

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
@@ -482,8 +482,13 @@ def reset_page_counter(key)
482482
private
483483
def delete_on_bucket(filename)
484484
bucket = @s3.buckets[@bucket]
485+
486+
first = Pathname.new @temporary_directory
487+
second = Pathname.new filename
485488

486-
remote_filename = "#{@prefix}#{File.basename(filename)}"
489+
remote_filename_path = second.relative_path_from first
490+
491+
remote_filename = remote_filename_path.to_s
487492

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

0 commit comments

Comments
 (0)