fluent-plugin-filter-object-flatten 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 070fdfa2348040a969b76ee53658c1ba33c3586a
4
- data.tar.gz: e23b781fdf63631a93bf1e3b9a68180e47619e08
3
+ metadata.gz: 59dcecf84b047f37b27e20f9f2f074f8664a8264
4
+ data.tar.gz: aa75d348ef841f95a796236763bc232a3488a504
5
5
  SHA512:
6
- metadata.gz: df7a6467ba7faa45d6495b8203314a75cfe98f029990545548fdd391a908795900412c093ba969aa4f7d9b971557b7985f18f268d3855a07b05562721f28c991
7
- data.tar.gz: 2182f6d392c9fd193075fb932d0e21fbc90ff47ce5bfa3e480c583156fc72e3573adab1952cdc1f47991cec50dbc70f0b36e99bced646ea1c4662be1423b9a4d
6
+ metadata.gz: 8b195f7a32780018565ef553cf94e605670d40109fa83cb89cfd0d4f4ded051e41131b1eaf10bd9120f4227d3140bae75e12c9f859303f0a947938c448977c01
7
+ data.tar.gz: 1753d9ca765569b475f909036e1fa8c5f858ddd7fa271076c7c6ff9f17497333a82df335df4d496d614510488af48b2cfe2ff53d2dd7b56cac3765aa757c426c
data/README.md CHANGED
@@ -23,11 +23,13 @@ Or install it yourself as:
23
23
 
24
24
  $ gem install fluent-plugin-filter-object-flatten
25
25
 
26
+ ## Configuration
26
27
 
27
28
  ```apache
28
29
  <filter>
29
- type fluent-plugin-filter-object-flatten
30
+ type object_flatten
30
31
  #separator .
32
+ #tr [" /", "__"]
31
33
  </filter>
32
34
  ```
33
35
 
@@ -6,12 +6,24 @@ module Fluent
6
6
  Plugin.register_filter('object_flatten', self)
7
7
 
8
8
  config_param :separator, :string, :default => '.'
9
+ config_param :tr, :array, :default => []
9
10
 
10
11
  def filter_stream(tag, es)
11
12
  result_es = Fluent::MultiEventStream.new
12
13
 
13
14
  es.each do |time, record|
14
15
  ObjectFlatten.flatten(record, @separator).each do |new_record|
16
+ unless @tr.empty?
17
+ new_record_with_tr = {}
18
+
19
+ new_record.each do |key, value|
20
+ key = key.tr(*@tr)
21
+ new_record_with_tr[key] = value
22
+ end
23
+
24
+ new_record = new_record_with_tr
25
+ end
26
+
15
27
  result_es.add(time, new_record)
16
28
  end
17
29
  end
@@ -1,3 +1,3 @@
1
1
  module FluentPluginFilterObjectFlatten
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-filter-object-flatten
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Genki Sugawara