diff --git a/lib/fluent/plugin/out_relabel.rb b/lib/fluent/plugin/out_relabel.rb index 28fbfabcdc..3ee74f1b69 100644 --- a/lib/fluent/plugin/out_relabel.rb +++ b/lib/fluent/plugin/out_relabel.rb @@ -28,5 +28,10 @@ def multi_workers_ready? def process(tag, es) router.emit_stream(tag, es) end + + def write(chunk) + return if chunk.empty? + router.emit_stream(chunk.metadata.tag, Fluent::MessagePackEventStream.new(chunk.read)) + end end end diff --git a/lib/fluent/plugin/output.rb b/lib/fluent/plugin/output.rb index 0aed67db95..8aa4fc8522 100644 --- a/lib/fluent/plugin/output.rb +++ b/lib/fluent/plugin/output.rb @@ -1384,6 +1384,7 @@ def retry_state(randomize) end def submit_flush_once + return unless @buffer_config.flush_thread_count > 0 # Without locks: it is rough but enough to select "next" writer selection @output_flush_thread_current_position = (@output_flush_thread_current_position + 1) % @buffer_config.flush_thread_count state = @output_flush_threads[@output_flush_thread_current_position]