Skip to content

Latest commit

 

History

History
94 lines (68 loc) · 2.55 KB

README.md

File metadata and controls

94 lines (68 loc) · 2.55 KB

fluent-plugin-filter-split

Fluentd filter plugin to split specified field.

Compared to existing plugins:

Thus, about above plugins, there are limitation of type of field or missing feature to control keep/remove other fields.

Installation

RubyGems

$ gem install fluent-plugin-filter-split

Bundler

Add following line to your Gemfile:

gem "fluent-plugin-filter-split"

And then execute:

$ bundle

Configuration

parameter type description default
split_key string (required) Specify a target key to split
keep_other_key bool (optional) Specify a flag whether other key must be kept or not false
keep_keys array (optional) Specify keys to be kept in filtered record []
remove_keys array (optional) Specify keys to be removed in filtered record []

Example

<filter test>
  @type filter_split
  split_key target_field
  keep_other_key true
</filter>

If following record is passed:

{'foo:'bar', 'target_field':[ {'k1':'v1'}, {'k2':'v2'} ] }

Then, you got:

{'foo:'bar', 'k1':'v1'}
{'foo:'bar', 'k2':'v2'}

If following record is passed:

{'foo:'bar', 'target_field':[ 'v1', 'v2' ] }

Then, you got:

{'foo:'bar', 'target_field':'v1'}
{'foo:'bar', 'target_field':'v2'}

Copyright

  • Copyright(c) 2023- Kentaro Hayashi
  • License
    • Apache License, Version 2.0