You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: lib/logstash/outputs/s3.rb
+13-19
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,7 @@
7
7
require"thread"
8
8
require"tmpdir"
9
9
require"fileutils"
10
-
require'pathname'
10
+
require"pathname"
11
11
12
12
13
13
# INFORMATION:
@@ -61,7 +61,7 @@
61
61
# time_file => 5 (optional)
62
62
# format => "plain" (optional)
63
63
# canned_acl => "private" (optional. Options are "private", "public_read", "public_read_write", "authenticated_read". Defaults to "private" )
64
-
# no_event_wait => 5 (optional. Defines the number of time_file s3 upload events that may go with no eventns for the prefix, before cleaning up the watch on that)
64
+
# no_event_wait => 5 (optional. Defines the number of time_file s3 upload events that may go with no events for the prefix, before cleaning up the watch on that)
@logger.debug("S3: Creating a new temporary file",:filename=>filename)
186
184
@tempfile[prefix]=File.open(filename,"a")
187
185
end
@@ -216,8 +214,6 @@ def register
216
214
217
215
test_s3_write
218
216
restore_from_crashesif@restore == true
219
-
#reset_page_counter
220
-
#create_temporary_file
221
217
configure_periodic_rotationiftime_file != 0
222
218
configure_upload_workers
223
219
@@ -260,7 +256,7 @@ def restore_from_crashes
260
256
end
261
257
262
258
public
263
-
defshouldcleanup(prefix)
259
+
defneed_cleanup?(prefix)
264
260
return@empty_uploads[prefix] > @no_event_wait
265
261
end
266
262
@@ -271,8 +267,7 @@ def move_file_to_bucket(file)
271
267
272
268
basepath=Pathname.new@temporary_directory
273
269
dirname=Pathname.newFile.dirname(file)
274
-
prefixpath=dirname.relative_path_frombasepath
275
-
prefix=prefixpath.to_s
270
+
prefix=dirname.relative_path_from(basepath).to_s
276
271
@logger.debug("S3: moving the file for prefix",:prefix=>prefix)
277
272
278
273
if !File.zero?(file)
@@ -298,9 +293,8 @@ def move_file_to_bucket(file)
298
293
@logger.error("S3: Logstash doesnt have the permission to delete the file in the temporary directory.",:filename=>File.basename(file),:temporary_directory=>@temporary_directory)
0 commit comments