A Fluentd plugin to split fluentd events into multiple records
MIT License
A Fluentd plugin to split fluentd events into multiple records
Fluentd >= v0.12
Use RubyGems:
gem install fluent-plugin-record-splitter
input_key
from the generated events.<match pattern>
@type record_splitter
tag splitted.log
input_key message
split_stratgey lines
append_new_line true
remove_new_line true
shared_keys ["akey"]
</match>
If following record is passed:
{'akey':'c', 'abkey':'cc', 'message': 'line one\nlines2' }
then you got new records like below:
{'akey':'c', 'message': 'line one' }
{'akey':'c', 'message': 'lines2' }
another configuration
<match pattern>
@type record_splitter
tag splitted.log
input_key message
split_stratgey regex
split_regex /\d+\s<\d+>.+/
remove_keys ["akey"]
</match>
If following record is passed:
{'dkey':'c', 'akey':'c', 'abkey':'cc', 'message': '83 <40>1 2012-11-30T06:45:29+00:00 start app\n90 <40>1 2012-11-30T06:45:26+00:00 host app web.3 - Starting process' }
then you got new records like below:
{'dkey':'c', 'abkey':'cc', 'message': '83 <40>1 2012-11-30T06:45:29+00:00 start app' }
{'dkey':'c', 'abkey':'cc', 'message': '90 <40>1 2012-11-30T06:45:26+00:00 host app web.3 - Starting process' }
See CHANGELOG.md for details.
git checkout -b my-new-feature
)git commit -am 'Add some feature'
)git push origin my-new-feature
)Copyright (c) 2015 Naotoshi Seo. See LICENSE for details.