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
@@ -8,7 +8,7 @@
8
8
require"thread"
9
9
require"tmpdir"
10
10
require"fileutils"
11
-
require'pathname'
11
+
require"pathname"
12
12
13
13
14
14
# 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)
196
194
@tempfile[prefix]=File.open(filename,"a")
197
195
end
@@ -226,8 +224,6 @@ def register
226
224
227
225
test_s3_write
228
226
restore_from_crashesif@restore == true
229
-
#reset_page_counter
230
-
#create_temporary_file
231
227
configure_periodic_rotationiftime_file != 0
232
228
configure_upload_workers
233
229
@@ -270,7 +266,7 @@ def restore_from_crashes
270
266
end
271
267
272
268
public
273
-
defshouldcleanup(prefix)
269
+
defneed_cleanup?(prefix)
274
270
return@empty_uploads[prefix] > @no_event_wait
275
271
end
276
272
@@ -281,8 +277,7 @@ def move_file_to_bucket(file)
281
277
282
278
basepath=Pathname.new@temporary_directory
283
279
dirname=Pathname.newFile.dirname(file)
284
-
prefixpath=dirname.relative_path_frombasepath
285
-
prefix=prefixpath.to_s
280
+
prefix=dirname.relative_path_from(basepath).to_s
286
281
@logger.debug("S3: moving the file for prefix",:prefix=>prefix)
287
282
288
283
if !File.zero?(file)
@@ -308,9 +303,8 @@ def move_file_to_bucket(file)
308
303
@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