Repository is archived
No commit activity in last 3 years
No release in over 3 years
Filter Plugin to create a new record containing the values converted by jq.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies

Development

>= 0
>= 3.0.0

Runtime

 Project Readme

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"}