Subscribed unsubscribe Subscribe Subscribe

Kentaro Kuribayashi's blog

Software Engineering, Management, Books, and Daily Journal.

Released fluent-plugin-extract_query_params 0.0.1

fluent-plugin-extract_query_params has been released. You can download and install it from both GitHub and RubyGems.

This plugin extracts key/value pairs from URL query parameters. Imagin you have a config as below:

<match test.**>
  type extract_query_params

  key            url
  add_tag_prefix extracted.
  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"
}

As you can see:

  • foo and baz key and their values are extracted and added into the record
  • hoge parameter is not extracted because only param is set foo, baz.

For details, see the documentation at GitHub.

Enjoy!