From e7e730803947d0b975ee4075de01283bc4bab788 Mon Sep 17 00:00:00 2001 From: Shizuo Fujita Date: Thu, 2 Jul 2026 18:02:48 +0900 Subject: [PATCH] in_s3: allow duplicate keys in JSON parser The json gem emits a deprecation warning for duplicate keys in JSON objects and will raise `JSON::ParserError` in json 3.0 unless `allow_duplicate_key: true` is specified. The plugin has historically accepted duplicate keys silently (last value wins). To preserve this behavior uniformly regardless of the json gem version, this passes `allow_duplicate_key: true` to `JSON.parse`. Signed-off-by: Shizuo Fujita --- lib/fluent/plugin/in_s3.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/fluent/plugin/in_s3.rb b/lib/fluent/plugin/in_s3.rb index 43c001b..4ebe989 100644 --- a/lib/fluent/plugin/in_s3.rb +++ b/lib/fluent/plugin/in_s3.rb @@ -213,7 +213,7 @@ def run begin @poller.poll(options) do |message| begin - body = JSON.parse(message.body) + body = JSON.parse(message.body, allow_duplicate_key: true) log.debug(body) next unless is_valid_queue(body) # skip test queue if @match_regexp