From 5f5333c33f27d1a747145cfa735efe046bc24f33 Mon Sep 17 00:00:00 2001 From: Tim Foerster Date: Wed, 6 Mar 2024 08:45:18 +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". Signed-off-by: Tim Foerster --- 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