Fluentd formatter plugin for formatting record to pretty json.
fluent-plugin-formatter_pretty_json | fluentd | ruby |
---|---|---|
>= 1.0.0 | >= v0.14.0 | >= 2.1 |
< 1.0.0 | >= v0.12.0 | >= 1.9 |
Install by gem:
$ gem install fluent-plugin-formatter_pretty_json
Or if you use td-agent:
$ flunet-gem install fluent-plugin-formatter_pretty_json
You simply specify pretty_json
at format
config param in formatter available plugins.
Like below:
<match test.**>
type file
path /path/to/file
format pretty_json
</match>
Output is like below:
{
"foo": "bar",
"test": "hoge"
}
{
"foo": "bar",
"test": "hoge"
}
Also you can use include_time_key
, time_key
, time_format
,
include_tag_key
, tag_key
, localtime
, timezone
parameters.
If you use these parameters, you see http://docs.fluentd.org/articles/out_file#format .
- 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 a new Pull Request