fluent-plugin-extract_query_params, a plugin for Fluentd
Fluentd plugin to extract key/values from URL query parameters.
fluent-plugin-extract_query_params | fluentd | ruby |
---|---|---|
>= 0.1.0 | >= v0.14.0 | >= 2.1 |
< 0.1.0 | >= v0.12.0 | >= 1.9 |
Caveat: This plugin, from version 0.1.0, supports fluentd of version v0.14 or higher. If you want to use this plugin with fluentd v0.12 or earlier, choose 0.0.x versions.
Imagin you have a config as below:
<filter test.**>
@type extract_query_params
key url
only foo, baz
</match>
And you feed such a value into fluentd:
"test" => {
"url" => "http://example.com/?foo=bar&baz=qux&hoge=fuga"
}
Then you'll get re-emmited tag/record-s below:
"extracted.test" => {
"url" => "http://example.com/?foo=bar&baz=qux&hoge=fuga"
"foo" => "bar",
"baz" => "qux"
}
hoge
parameter is not extracted.
key
is used to point a key whose value contains URL string.
These params are included from Fluent::HandleTagNameMixin
. See the code for details.
You must add at least one of these params.
If set, only the key/value whose key is included only
will be added to the record.
If set, the key/value whose key is included except
will NOT be added to the record.
If set to true
, the original key
url will be discarded from the record. Defaults to false
(preserve key).
If set to true
, scheme (use url_scheme
key) will be added to the record. Defaults to false
.
If set to true
, host (use url_host
key) will be added to the record. Defaults to false
.
If set to true
, port (use url_port
key) will be added to the record. Defaults to false
.
If set to true
, path (use url_path
key) will be added to the record. Defaults to false
.
Add this line to your application's Gemfile:
gem 'fluent-plugin-extract_query_params'
And then execute:
$ bundle
Or install it yourself as:
$ gem install fluent-plugin-extract_query_params
- 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- Kentaro Kuribayashi (@kentaro)
Apache License, Version 2.0