We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2cb45d7 commit 515e351Copy full SHA for 515e351
lib/fluent/plugin/out_file.rb
@@ -17,6 +17,7 @@
17
require 'fileutils'
18
require 'zlib'
19
require 'time'
20
+require 'pathname'
21
22
require 'fluent/plugin/output'
23
require 'fluent/config/error'
@@ -97,7 +98,8 @@ def generate_chunk(metadata)
97
98
if chunk.metadata == @latest_metadata
99
sym_path = @_output_plugin_for_symlink.extract_placeholders(@_symlink_path, chunk)
100
FileUtils.mkdir_p(File.dirname(sym_path), mode: @_output_plugin_for_symlink.dir_perm)
- FileUtils.ln_sf(chunk.path, sym_path)
101
+ relative_path = Pathname.new(chunk.path).relative_path_from(Pathname.new(File.dirname(sym_path)))
102
+ FileUtils.ln_sf(relative_path, sym_path)
103
end
104
chunk
105
0 commit comments