Filter Plugin to create a new record containing the values converted by jq.
Ruby Shell
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
bin first commit Jul 12, 2015
lib
spec
.gitignore
.rspec
.travis.yml
Gemfile
LICENSE.txt
README.md
Rakefile
fluent-plugin-filter-jq.gemspec

README.md

fluent-plugin-filter-jq

Filter Plugin to create a new record containing the values converted by jq.

It is requires ruby-jq. see ruby-jq#Installation

Gem Version Build Status

Installation

Add this line to your application's Gemfile:

gem 'fluent-plugin-filter-jq'

And then execute:

$ bundle

Or install it yourself as:

$ gem install fluent-plugin-filter-jq

Configuration

<filter>
  type jq
  # see http://stedolan.github.io/jq/manual/
  jq '{foo: .bar}'
  # no_hash_root_key .
</filter>

Usage

$ cat fluent.conf
<source>
  @type forward
  @id forward_input
</source>

<filter>
  type jq

  # swap value
  jq '{foo:.zoo,zoo:.foo}'
</filter>

<match **>
  @type stdout
  @id stdout_output
</match>

$ fluentd -c fluent.conf
$ echo '{"foo":"bar", "zoo":"baz"}' | fluent-cat test.data
#=> 2015-01-01 23:34:45 +0900 test.data: {"zoo":"bar","foo":"baz"}