fluent-plugin-tagdata, a plugin for Fluentd
Fluentd plugin to put the tag records in the data.
Fluentd plugin to put the tag records in the data.
Imagin you have a config as below:
<match example.**>
type tagdata
out_keys server,protocol,domain
add_tag_prefix filtered.
remove_tag_prefix example.
</match>
And you feed such a value into fluentd:
"example.straycat.http.www.example.com" => {
"host":"localhost",
"user":"-",
"method":"GET",
"path":"/sample.html",
"code":"200",
"size":"1234",
"referer":"-",
"agent":"Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22",
"response":"1234567"
}
Then you'll get re-emmited tag/record below:
"filtered.straycat.http.www.example.com" => {
"host":"localhost",
"user":"-",
"method":"GET",
"path":"/sample.html",
"code":"200",
"size":"1234",
"referer":"-",
"agent":"Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22",
"response":"1234567",
"server":"straycat",
"protocol":"http",
"domain":"http.www.example.com"
}
The out_keys
is used to point keys whose value contains CSV-formatted string.
The firstpoint
is used to a first point number of piriod-separated-tags.
Default value is 1.
These params are included from Fluent::HandleTagNameMixin
. See that code for details.
You must add at least one of these params.
Add this line to your application's Gemfile:
gem 'fluent-plugin-tagdata'
And then execute:
$ bundle
Or install it yourself as:
$ gem install fluent-plugin-tagdata
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Added some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request
Copyright (c) 2013- Fukui Masayuki (@msfukui)
Apache License, Version 2.0