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:
@@ -60,7 +60,7 @@
60
60
# size_file => 2048 (optional)
61
61
# time_file => 5 (optional)
62
62
# canned_acl => "private" (optional. Options are "private", "public_read", "public_read_write", "authenticated_read". Defaults to "private" )
63
-
# 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)
63
+
# 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)
185
183
@tempfile[prefix]=File.open(filename,"a")
186
184
end
@@ -215,8 +213,6 @@ def register
215
213
216
214
test_s3_write
217
215
restore_from_crashesif@restore == true
218
-
#reset_page_counter
219
-
#create_temporary_file
220
216
configure_periodic_rotationiftime_file != 0
221
217
configure_upload_workers
222
218
@@ -259,7 +255,7 @@ def restore_from_crashes
259
255
end
260
256
261
257
public
262
-
defshouldcleanup(prefix)
258
+
defneed_cleanup?(prefix)
263
259
return@empty_uploads[prefix] > @no_event_wait
264
260
end
265
261
@@ -270,8 +266,7 @@ def move_file_to_bucket(file)
270
266
271
267
basepath=Pathname.new@temporary_directory
272
268
dirname=Pathname.newFile.dirname(file)
273
-
prefixpath=dirname.relative_path_frombasepath
274
-
prefix=prefixpath.to_s
269
+
prefix=dirname.relative_path_from(basepath).to_s
275
270
@logger.debug("S3: moving the file for prefix",:prefix=>prefix)
276
271
277
272
if !File.zero?(file)
@@ -297,9 +292,8 @@ def move_file_to_bucket(file)
297
292
@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