fluent-plugin-filter-record-map 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: 0cb7b8c69d6c985a33f5d9fbec04c755f2d711ca
4
- data.tar.gz: c562f157f5a4d8ff2789ccb5b947a9125baa8e54
3
+ metadata.gz: c3cc9ccf5e8a0bd317bc5728a5866e398913569b
4
+ data.tar.gz: ce935a8c184a51ba89eebf48851ce33c441188e8
5
5
  SHA512:
6
- metadata.gz: 272c1a8f9fe1c1af921d19ccfc4b517e9c16bd1babac6e64233fa87fde3dd8da39ca84dbaa28a09c482ca95ce756cf95da193686ca7b95436cedbb750f42079f
7
- data.tar.gz: 462042e80dab6c833805adc4ba7d01d2f06c40f49e8669790547f299217695772e20e90774bf727aed32c4edce6a9e107bc58d0357b4ccec8cdc84aacd7446b8
6
+ metadata.gz: 074dc87359695fbecc555422800d6f48b996587c968a324d9ab1e65a51fa4155b60cb1a6e0236c575fb89e9c0558b253c72a26daaf99fe3ade148872c351f685
7
+ data.tar.gz: 6665995e6ab6ac36c740801e0eadb3928e8e5aeacd1ef3fb81ad67d729da0749964256c5f69dca8fef082d3700865fc3767485608fd17f6ddf18d09470b322fd
data/README.md CHANGED
@@ -60,6 +60,20 @@ $ echo '{"foo":"bar", "bar":"zoo"}' | fluent-cat test.data
60
60
  #=> 2015-01-01 23:34:45 +0900 test.data: {"foo":"foo.bar","bar":"bar.zoo"}
61
61
  ```
62
62
 
63
+ ### Example3
64
+
65
+ ```apache
66
+ <filter>
67
+ type record_map
68
+ map new_record = {"new_foo" => record["foo"]}
69
+ </filter>
70
+ ```
71
+
72
+ ```sh
73
+ $ echo '{"foo":"bar", "bar":"zoo"}' | fluent-cat test.data
74
+ #=> 2015-01-01 23:34:45 +0900 test.data: {"new_foo":"bar"}
75
+ ```
76
+
63
77
  ### Use `tag`, `tag_parts`
64
78
 
65
79
  ```apache
@@ -19,20 +19,10 @@ module Fluent
19
19
  @context = Context.new
20
20
  end
21
21
 
22
- def filter_stream(tag, es)
23
- result_es = Fluent::MultiEventStream.new
24
-
25
- es.each do |time, record|
26
- bind = @context.context(tag, record)
27
- eval(@map, bind)
28
- new_record = eval('new_record', bind)
29
- result_es.add(time, new_record)
30
- end
31
-
32
- result_es
33
- rescue => e
34
- log.warn e.message
35
- log.warn e.backtrace.join(', ')
22
+ def filter(tag, time, record)
23
+ bind = @context.context(tag, record)
24
+ eval(@map, bind)
25
+ eval('new_record', bind)
36
26
  end
37
27
  end
38
28
  end
@@ -1,3 +1,3 @@
1
1
  module FluentPluginFilterSimpleMap
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-record-map
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