From 6cace97fcbe55da3106ba55d6561d8f9e40d476b Mon Sep 17 00:00:00 2001 From: Daijiro Fukuda Date: Fri, 26 Apr 2024 18:24:14 +0900 Subject: [PATCH] Add comment about limitation of filter_parser specification Config to reproduce: @type sample tag test.array sample {"message": "[{\"k\":\"v\"}, {\"k2\":\"v2\"}]"} @type parser key_name message @type json @type stdout Result: 2023-03-21 23:24:52.004470792 +0900 test.array: {"k":"v"} 2023-03-21 23:24:52.004470792 +0900 test.array: {"k":"v"} ... Signed-off-by: Daijiro Fukuda --- lib/fluent/plugin/filter_parser.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/fluent/plugin/filter_parser.rb b/lib/fluent/plugin/filter_parser.rb index e9c03fd944..52909d0171 100644 --- a/lib/fluent/plugin/filter_parser.rb +++ b/lib/fluent/plugin/filter_parser.rb @@ -79,6 +79,10 @@ def filter_with_time(tag, time, record) end @accessor.delete(record) if @remove_key_name_field r = handle_parsed(tag, record, t, values) + # Note: https://github.com/fluent/fluentd/issues/4100 + # If the parser returns multiple records from one raw_value, + # this returns only the first one record. + # This should be fixed in the future version. return t, r else if @emit_invalid_record_to_error