fluent-plugin-reassemble 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/README.rdoc +20 -19
- data/fluent-plugin-reassemble.gemspec +1 -1
- data/lib/fluent/plugin/out_reassemble.rb +3 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ZDcwN2ExYzM1MjU4NzFiNTAzNmIzNWMyY2Q1YTVlYzJmYjYyNTAwNw==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
Mjg1ZDhlNDYwZGE2Y2VjZmRkYTBmZDI5OTIyYTAyOTFhYjViMDM1Zg==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
Njg5MzdmNjViZDJmZWZjYTdkOTVkZWJjOTJmMTIwZTliMTk5ODZiNzA3Nzg0
|
10
|
+
YTcwMzAzNjU2NTE0N2ZmZTc0ZGQyOTVkMjg0MjA4NGZhNWJjOTgxZDk2MTBk
|
11
|
+
OGE1NTQxOGYzYTg3OTA5ZWYzZjBiNmYxN2NhZjY3MDA4ZjVlODI=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
YmNlZDkxOTg4Y2UwYjY4YzgyOWUxNDkyNzQ3OTA5ZDQwNWY0OThiMjRlNjQx
|
14
|
+
OGQyZDE3NWQxZmVjNGFlNDM4ZTAyYTJjMzAwM2UxZGM4Mzk2YTQzZTEwMzUy
|
15
|
+
MmI1ZDIwNWY2MWM0ZWM4MzYxMDM4ZjI2N2RlYTE4ZDVlZjJkNWI=
|
data/README.rdoc
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
= re-
|
1
|
+
= re-assembe a stream data (for Fluentd output plugin)
|
2
2
|
|
3
3
|
== Overview
|
4
4
|
|
@@ -20,28 +20,29 @@
|
|
20
20
|
</match>
|
21
21
|
|
22
22
|
=== 'assemble' format
|
23
|
-
{extract_key1}:{replaced_key1}:{operation1},{extract_key2}:{replaced_key2}:{operation2},....{extract_keyN}:{replaced_keyN}:{operationN}
|
23
|
+
{extract_key1}:{replaced_key1}:{operation1},{extract_key2}:{replaced_key2}:{operation2},....{extract_keyN}:{replaced_keyN}:{operationN}
|
24
24
|
|
25
|
-
ex1.
|
26
|
-
assemble foo1:bar1:to_i, foo2:bar2:to_s
|
27
|
-
record => {"foo1": "1", "foo2": 2}
|
28
|
-
reassemble => {"bar1": 1, "bar2": "2"}
|
25
|
+
ex1.
|
26
|
+
assemble foo1:bar1:to_i, foo2:bar2:to_s
|
27
|
+
record => {"foo1": "1", "foo2": 2}
|
28
|
+
reassemble => {"bar1": 1, "bar2": "2"}
|
29
29
|
|
30
|
-
ex2.
|
31
|
-
assemble foo1,foo2:bar2,foo3:bar3:unixtime_to_datetime,foo4:bar4:url_to_host
|
32
|
-
record => {"foo1": "1", "foo2": 2, "foo3": 1377946931, "foo4": "http://www.sada.co.jp/concert.html"}
|
33
|
-
reassemble => {"foo1": "1", "bar2": 2, "bar3": "2013-08-31 20:00:02", "bar4": "www.sada.co.jp"}
|
30
|
+
ex2.
|
31
|
+
assemble foo1,foo2:bar2,foo3:bar3:unixtime_to_datetime,foo4:bar4:url_to_host
|
32
|
+
record => {"foo1": "1", "foo2": 2, "foo3": 1377946931, "foo4": "http://www.sada.co.jp/concert.html"}
|
33
|
+
reassemble => {"foo1": "1", "bar2": 2, "bar3": "2013-08-31 20:00:02", "bar4": "www.sada.co.jp"}
|
34
34
|
|
35
35
|
=== 'operation' list
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
36
|
+
|
37
|
+
to_s:: to string
|
38
|
+
to_i:: to integer
|
39
|
+
to_f:: to float
|
40
|
+
unixtime_to_datetime:: convert from unixtime to datetime(string)
|
41
|
+
unixtime_to_date:: convert from unixtime to date(string)
|
42
|
+
unixtime_to_time:: convert from unixtime to time(string)
|
43
|
+
url_to_domain:: extract host from url
|
44
|
+
url_to_host:: extract host from url
|
45
|
+
url_to_path:: extract path from url
|
45
46
|
|
46
47
|
== Copyright
|
47
48
|
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
2
|
Gem::Specification.new do |gem|
|
3
3
|
gem.name = "fluent-plugin-reassemble"
|
4
|
-
gem.version = "0.0.
|
4
|
+
gem.version = "0.0.2"
|
5
5
|
gem.authors = ["moaikids"]
|
6
6
|
gem.licenses = ["Apache License Version 2.0"]
|
7
7
|
gem.summary = %q{Re-assemble a stream data for Fluentd}
|
@@ -56,7 +56,7 @@ module Fluent
|
|
56
56
|
replaced_key = conf[:replace]
|
57
57
|
operation = conf[:operation]
|
58
58
|
val = convert(traverse(record, extract_key), operation)
|
59
|
-
if val
|
59
|
+
if !(val.nil?)
|
60
60
|
json[replaced_key] = val
|
61
61
|
elsif @null_to_null
|
62
62
|
json[replaced_key] = nil
|
@@ -81,10 +81,10 @@ module Fluent
|
|
81
81
|
end
|
82
82
|
|
83
83
|
def convert(val, operation)
|
84
|
-
|
84
|
+
if val.nil?
|
85
85
|
return val
|
86
86
|
end
|
87
|
-
|
87
|
+
if operation.nil?
|
88
88
|
return val
|
89
89
|
end
|
90
90
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluent-plugin-reassemble
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- moaikids
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-09-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|