Sha256: 035eab8292dde5b4476ce443cfe29e0429b72c3bf5cdd973a9e5c651f7e48e18

Contents?: true

Size: 1.55 KB

Versions: 2

Compression:

Stored size: 1.55 KB

Contents

# fluent-plugin-record_indexing

[Fluentd](https://fluentd.org/) Filter plugin to spin entry with an array field into multiple entries.

## Examples
```
<filter test**>
    @type                 record_indexing
    check_all_key         false
    key_name              baz
    key_prefix            baz_0
</filter>

In:
{"foo" => "bar", "baz" => [{"a" => 1}, {"a" => 2}, {"b" => 3}]}
Out:
{"foo"=>"bar", "baz"=>{"baz_0"=> {"a" => 1} , "baz_1"=> {"a" => 2}, "baz_2"=>{"b"=>3}}}
```
```
<filter test**>
    @type                 record_indexing
    check_all_key         false
    key_name              baz
</filter>

In:
{"foo" => "bar", "baz" => [{"a" => 1}, {"a" => 2}, {"b" => 3}],  "daz" => [{"a"=>1}, {"a"=>2}, {"b"=>3}]}
Out:
{"foo"=>"bar", "baz"=>{"0"=> {"a" => 1} , "1"=>{"a" => 2}, "2"=>{"b"=>3}},  "daz" => [{"a"=>1}, {"a"=>2}, {"b"=>3}]}

```
```
<filter test**>
    @type                 record_indexing
</filter>

In:
{"foo" => "bar", "baz"=>[{"a"=>1}, {"a"=>2}, {"b"=>3}] , "daz" => [{"a"=>1}, {"a"=>2}, {"b"=>3}]}
Out:
{"foo"=>"bar", "baz"=>{"0"=>{"a"=>1} , "1"=>{"a"=>2}, "2"=>{"b"=>3}}, "daz"=>{"0"=>{"a"=>1} , "1"=>{"a"=>2}, "2"=>{"b"=>3}}}
```

## Installation

### RubyGems

```
$ gem install fluent-plugin-array-spin
```

### Bundler

Add the following line to your Gemfile:

```ruby
gem "fluent-plugin-record_indexing"
```

And then execute:

```
$ bundle
```

## Configuration

* **key_name** (string)
* **key_prefix** (string)
* **check_all_key**  (bool) default: true


## Copyright

* Copyright(c) 2017, Tema Novikov
* License
  * Apache License, Version 2.0

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
fluent-plugin-record_indexing-0.2.1 README.md
fluent-plugin-record_indexing-0.2.0 README.md