fluent-plugin-filter_empty_keys
A Fluentd filter plugin to filter empty keys
Requirements
Fluentd >= v0.12
Install
Use RubyGems:
gem install fluent-plugin-filter_empty_keys
Configuration Examples
<source>
@type dummy
tag dummy
dummy {"field1":"", "field2":"2", "field3":"2013-02-12 22:04:14 UTC", "field4":"", "field5":"a,b,c"}
</source>
<filter **>
@type empty_keys
</filter>
<match **>
@type stdout
</match>
You should see casted records:
dummy {"field2":"2", "field3":"2013-02-12 22:04:14 UTC", "field5":"a,b,c"}
<source>
@type dummy
tag dummy
dummy {"field0":0, "field1":"", "field2":"Undefined", "field3":"2013-02-12 22:04:14 UTC", "field4":"", "field5":"a,b,c"}
</source>
<filter **>
@type empty_keys
empty_keys field0:0,field2:Undefined
</filter>
<match **>
@type stdout
</match>
You should see casted records:
dummy {"field3":"2013-02-12 22:04:14 UTC", "field5":"a,b,c"}
<source>
@type dummy
tag dummy
dummy {"field0":0, "field1":"", "field2":"Undefined", "field3":"2013-02-12 22:04:14 UTC", "field4":"", "field5":"-"}
</source>
<filter **>
@type empty_keys
empty_values -,0
empty_values_delimiter ,
</filter>
<match **>
@type stdout
</match>
You should see casted records:
dummy {"field2":"Undefined","field3":"2013-02-12 22:04:14 UTC"}
ChangeLog
See CHANGELOG.md for details.
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request
Copyright
Copyright (c) 2015 Naotoshi Seo. See LICENSE for details.