Fluentd sprintf formatter plugin
Use RubyGems:
gem install fluent-plugin-formatter_sprintf
gem install fluent-plugin-formatter_sprintf -v 0.0.4
out_file and out_s3 plugin supports formatter plugin.
<match test.file>
type file
path /tmp/test.log
<format>
@type sprintf
sprintf_format "${tag} ${time} ${url} ${ip_address}\n"
</format>
time_format "%Y-%m-%d %H:%M:%S"
</match><match test.s3>
type s3
aws_key_id XXXXXXXXXXXXXXXXXX
aws_sec_key XXXXXXXXXXXXXXXXXX
s3_bucket sample-bucket
s3_object_key_format %{path}%{time_slice}%{index}
path logs/
buffer_path /tmp/fluent/s3
buffer_chunk_limit 8m
time_slice_format %Y/%m/%d/test.log.%H%M
time_slice_wait 1m
time_format %Y-%m-%d %H:%M:%S,%3N
store_as text
<format>
@type sprintf
sprintf_format "${tag} ${time} ${url} ${ip_address}\n"
</format>
</match> <format>
@type sprintf
sprintf_format "${tag} ${time} ${url} ${ip_address}\n"
sprintf_blank_string -
</format>2016-03-15 14:21:40 +0900 analysis.pageview: { "url": null, "ip_address": null }analysis.pageview 2016-01-01 00:00:00 - -
<format>
@type sprintf
sprintf_format "%s ${tag} ${time} ${url} ${ip_address}\n"
</format>See CHANGELOG.md for details.
- 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 (c) 2014 Hiroshi Toyama. See LICENSE for details.
