From 146f71dd240a8c76412574705948ee6dda102efa Mon Sep 17 00:00:00 2001 From: Tim Foerster Date: Wed, 6 Mar 2024 08:41:06 +0100 Subject: [PATCH] out_opensearch_data_stream: Early return on empty body Due to some reason the body could be empty which results in infinite jumps between failed buffer flushes. Opensearch returns a 400 with "request body is required". --- lib/fluent/plugin/out_opensearch_data_stream.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/fluent/plugin/out_opensearch_data_stream.rb b/lib/fluent/plugin/out_opensearch_data_stream.rb index 2b8e7f2..9140d8f 100644 --- a/lib/fluent/plugin/out_opensearch_data_stream.rb +++ b/lib/fluent/plugin/out_opensearch_data_stream.rb @@ -201,6 +201,8 @@ def write(chunk) end end + return if bulk_message.to_s.empty? + params = { index: data_stream_name, body: bulk_message