Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add parameter delimiter_pattern to parser_ltsv #1802

Merged
merged 2 commits into from
Dec 27, 2017

Conversation

okkez
Copy link
Contributor

@okkez okkez commented Dec 26, 2017

The feature is taken from
https://github.com/fluent-plugins-nursery/fluent-plugin-kv-parser

fluent-plugin-kv-parser is very simple and similar to parser_ltsv.
So we can integrate fluent-plugin-kv-parser with parser_ltsv.

The feature is taken from
https://github.com/fluent-plugins-nursery/fluent-plugin-kv-parser

fluent-plugin-kv-parser is very simple and similar to parser_ltsv.
So we can integrate fluent-plugin-kv-parser with parser_ltsv.
desc 'The delimiter character between field name and value'
config_param :label_delimiter, :string, default: ":"

config_set_default :time_key, 'time'

def parse(text)
r = {}
text.split(@delimiter).each do |pair|
delimiter = @delimiter_pattern || @delimiter
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about moving this to configure?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for reviewing. Good catch.

Because `#parse` is called for each event. On the other hand
`#configure` is called once on boot.
@repeatedly repeatedly merged commit bcd7d1a into fluent:master Dec 27, 2017
@okkez okkez deleted the add-delimiter-pattern-to-parser-ltsv branch January 9, 2018 06:20
okkez added a commit to okkez/fluentd-docs that referenced this pull request Mar 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants