No commit activity in last 3 years
No release in over 3 years
Fluentd Free formatter plugin, Use sprintf.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0
>= 0

Runtime

 Project Readme

fluent-plugin-formatter_sprintf

Build Status Gem Version

Fluentd sprintf formatter plugin

Install(Fluentd v0.14)

Use RubyGems:

gem install fluent-plugin-formatter_sprintf

Install(Fluentd v0.12)

gem install fluent-plugin-formatter_sprintf -v 0.0.4

Configuration Example

out_file and out_s3 plugin supports formatter plugin.

out_file

<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>

out_s3

<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>

blank string(include [nil, empty?, blank?])

  <format>
    @type sprintf
    sprintf_format "${tag} ${time} ${url} ${ip_address}\n"
    sprintf_blank_string -
  </format>
input
2016-03-15 14:21:40 +0900 analysis.pageview: { "url": null, "ip_address": null }
output
analysis.pageview 2016-01-01 00:00:00 - -

bad syntax(at error)

<format>
  @type sprintf
  sprintf_format "%s ${tag} ${time} ${url} ${ip_address}\n"
</format>

ChangeLog

See CHANGELOG.md for details.

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

Copyright

Copyright (c) 2014 Hiroshi Toyama. See LICENSE for details.