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 +4 -4
- data/README.md +14 -0
- data/lib/fluent/plugin/filter_record_map.rb +4 -14
- data/lib/fluent_plugin_filter_record_map/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c3cc9ccf5e8a0bd317bc5728a5866e398913569b
|
4
|
+
data.tar.gz: ce935a8c184a51ba89eebf48851ce33c441188e8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
23
|
-
|
24
|
-
|
25
|
-
|
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
|