Skip to content

Commit

Permalink
Add comment about limitation of filter_parser specification
Browse files Browse the repository at this point in the history
Config to reproduce:

    <source>
      @type sample
      tag test.array
      sample {"message": "[{\"k\":\"v\"}, {\"k2\":\"v2\"}]"}
    </source>

    <filter test.**>
      @type parser
      key_name message
      <parse>
        @type json
      </parse>
    </filter>

    <match test.**>
      @type stdout
    </match>

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 <fukuda@clear-code.com>
  • Loading branch information
daipom committed Apr 26, 2024
1 parent 7c80806 commit 01a1034
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/fluent/plugin/filter_parser.rb
Expand Up @@ -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
Expand Down

0 comments on commit 01a1034

Please sign in to comment.