fluent-plugin-typecast 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 +15 -0
- data/Gemfile.lock +36 -4
- data/README.rdoc +27 -9
- data/VERSION +1 -1
- data/fluent-plugin-typecast.gemspec +9 -9
- data/lib/fluent/plugin/out_typecast.rb +3 -1
- data/test/plugin/test_out_typecast.rb +14 -0
- metadata +51 -55
checksums.yaml
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
---
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
YWQ2YmQzMTk0YTVlYzE4NzcyY2JlMjY5ODYzMTZmMzY4ZWE1YmZlNw==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
ZDBkOTQxMjVjOTczYjEyY2Y2MDA0ZWNiYjEyMzE2MjIwMjJlMWU5ZA==
|
7
|
+
!binary "U0hBNTEy":
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
YjAyMWI5YmJjMTMyOGVmYjc3YmYxOGZlNTIxMWUzZjhjNzJmOWQ0NzVkZTJj
|
10
|
+
ODFkN2EyNTgyYzZmOWU4NWJkMjVjMGYxNmViMWM2MTFmZDM0YWM3Y2E0NDFj
|
11
|
+
NGQxNTIyMjU3MDExMzA3MzY4ZGQ0MzM1ZjhlNDg5OTIyMGY5N2I=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
NDAxNzI1MDQ5M2YzYjRkZDhkMmJhNGMyOTI5OGM1NDQ4OTEyNTZkMWMxYzc5
|
14
|
+
YjUxZmIwMmMyZjlkOGQ3YTFjYTc1YmVkY2QzYjgxOTY1MTlhYjkyNDU1N2Zi
|
15
|
+
OTdlYTI4ZWVjMmM1ZGVjNjAzYjY2NzBiYmE3ZjAyMWM4NDIwNjI=
|
data/Gemfile.lock
CHANGED
@@ -1,25 +1,57 @@
|
|
1
1
|
GEM
|
2
2
|
remote: https://rubygems.org/
|
3
3
|
specs:
|
4
|
+
addressable (2.3.5)
|
5
|
+
builder (3.2.2)
|
4
6
|
cool.io (1.1.0)
|
5
7
|
iobuffer (>= 1.0.0)
|
8
|
+
faraday (0.8.8)
|
9
|
+
multipart-post (~> 1.2.0)
|
6
10
|
fluentd (0.10.32)
|
7
11
|
cool.io (~> 1.1.0)
|
8
12
|
http_parser.rb (~> 0.5.1)
|
9
13
|
json (>= 1.4.3)
|
10
14
|
msgpack (~> 0.4.4)
|
11
15
|
yajl-ruby (~> 1.0)
|
12
|
-
git (1.2.
|
16
|
+
git (1.2.6)
|
17
|
+
github_api (0.10.1)
|
18
|
+
addressable
|
19
|
+
faraday (~> 0.8.1)
|
20
|
+
hashie (>= 1.2)
|
21
|
+
multi_json (~> 1.4)
|
22
|
+
nokogiri (~> 1.5.2)
|
23
|
+
oauth2
|
24
|
+
hashie (2.0.5)
|
25
|
+
highline (1.6.19)
|
13
26
|
http_parser.rb (0.5.3)
|
27
|
+
httpauth (0.2.0)
|
14
28
|
iobuffer (1.1.2)
|
15
|
-
jeweler (1.8.
|
29
|
+
jeweler (1.8.7)
|
30
|
+
builder
|
16
31
|
bundler (~> 1.0)
|
17
32
|
git (>= 1.2.5)
|
33
|
+
github_api (= 0.10.1)
|
34
|
+
highline (>= 1.6.15)
|
35
|
+
nokogiri (= 1.5.10)
|
18
36
|
rake
|
19
37
|
rdoc
|
20
|
-
json (1.
|
38
|
+
json (1.8.0)
|
39
|
+
jwt (0.1.8)
|
40
|
+
multi_json (>= 1.5)
|
21
41
|
msgpack (0.4.7)
|
22
|
-
|
42
|
+
multi_json (1.7.9)
|
43
|
+
multi_xml (0.5.5)
|
44
|
+
multipart-post (1.2.0)
|
45
|
+
nokogiri (1.5.10)
|
46
|
+
oauth2 (0.9.2)
|
47
|
+
faraday (~> 0.8)
|
48
|
+
httpauth (~> 0.2)
|
49
|
+
jwt (~> 0.1.4)
|
50
|
+
multi_json (~> 1.0)
|
51
|
+
multi_xml (~> 0.5)
|
52
|
+
rack (~> 1.2)
|
53
|
+
rack (1.5.2)
|
54
|
+
rake (10.1.0)
|
23
55
|
rdoc (3.12.2)
|
24
56
|
json (~> 1.4)
|
25
57
|
yajl-ruby (1.1.0)
|
data/README.rdoc
CHANGED
@@ -2,15 +2,33 @@
|
|
2
2
|
|
3
3
|
Description goes here.
|
4
4
|
|
5
|
-
==
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
5
|
+
== Configuration
|
6
|
+
|
7
|
+
[item_types] KEY:TYPE pairs separated by comma(,). support types:
|
8
|
+
|
9
|
+
- integer
|
10
|
+
- string
|
11
|
+
- time
|
12
|
+
- bool
|
13
|
+
- array
|
14
|
+
|
15
|
+
[time_format] format for typecast to time
|
16
|
+
|
17
|
+
[prefix] prefix string, add to the tag
|
18
|
+
|
19
|
+
=== Example
|
20
|
+
|
21
|
+
<match foo.bar>
|
22
|
+
item_types test1:integer,test2:string,test3:time,test4:bool
|
23
|
+
time_format %d/%b/%Y:%H:%M:%S %z
|
24
|
+
prefix typed
|
25
|
+
</match>
|
26
|
+
|
27
|
+
<match typed.foo.bar>
|
28
|
+
type mongo
|
29
|
+
database fluent_typed
|
30
|
+
collection test
|
31
|
+
</match>
|
14
32
|
|
15
33
|
== Copyright
|
16
34
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.1
|
@@ -4,14 +4,14 @@
|
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
|
-
s.name =
|
8
|
-
s.version = "0.1.
|
7
|
+
s.name = "fluent-plugin-typecast"
|
8
|
+
s.version = "0.1.1"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["MORIYA Taro"]
|
12
|
-
s.date =
|
13
|
-
s.description =
|
14
|
-
s.email =
|
12
|
+
s.date = "2013-08-29"
|
13
|
+
s.description = "typecast output plugin for fluentd"
|
14
|
+
s.email = "taro.toys@gmail.com"
|
15
15
|
s.extra_rdoc_files = [
|
16
16
|
"LICENSE.txt",
|
17
17
|
"README.rdoc"
|
@@ -29,14 +29,14 @@ Gem::Specification.new do |s|
|
|
29
29
|
"test/helper.rb",
|
30
30
|
"test/plugin/test_out_typecast.rb"
|
31
31
|
]
|
32
|
-
s.homepage =
|
32
|
+
s.homepage = "http://github.com/tarom/fluent-plugin-typecast"
|
33
33
|
s.licenses = ["Apache License 2.0"]
|
34
34
|
s.require_paths = ["lib"]
|
35
|
-
s.rubygems_version =
|
36
|
-
s.summary =
|
35
|
+
s.rubygems_version = "2.0.7"
|
36
|
+
s.summary = "typecast output plugin for fluentd"
|
37
37
|
|
38
38
|
if s.respond_to? :specification_version then
|
39
|
-
s.specification_version =
|
39
|
+
s.specification_version = 4
|
40
40
|
|
41
41
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
42
42
|
s.add_runtime_dependency(%q<fluentd>, ["~> 0.10.0"])
|
@@ -17,7 +17,7 @@ class TypecastOutput < Output
|
|
17
17
|
config_param :tag, :string, default: nil
|
18
18
|
config_param :prefix, :string, default: nil
|
19
19
|
|
20
|
-
ITEM_TYPES = ['string', 'integer', 'bool', 'time', 'array']
|
20
|
+
ITEM_TYPES = ['string', 'integer', 'float', 'bool', 'time', 'array']
|
21
21
|
|
22
22
|
def configure(conf)
|
23
23
|
super
|
@@ -46,6 +46,8 @@ class TypecastOutput < Output
|
|
46
46
|
value.to_s
|
47
47
|
when 'integer'
|
48
48
|
value.to_i
|
49
|
+
when 'float'
|
50
|
+
value.to_f
|
49
51
|
when 'bool'
|
50
52
|
Config.bool_value(value)
|
51
53
|
when 'time'
|
@@ -57,6 +57,20 @@ class TestTypecastOutput < Test::Unit::TestCase
|
|
57
57
|
assert_equal('other', record['o'])
|
58
58
|
end
|
59
59
|
|
60
|
+
def test_typecast_float
|
61
|
+
d = create_driver(DEFAULT_CONFIG + %[
|
62
|
+
tag test.tag
|
63
|
+
item_types f:float
|
64
|
+
])
|
65
|
+
v = 1.1
|
66
|
+
time = Time.parse('2013-02-12 22:01:15 UTC').to_i
|
67
|
+
d.run do
|
68
|
+
d.emit({'f' => v.to_s }, time)
|
69
|
+
end
|
70
|
+
record = d.emits[0][2]
|
71
|
+
assert_equal(v, record['f'])
|
72
|
+
end
|
73
|
+
|
60
74
|
def test_prefix
|
61
75
|
d = create_driver(DEFAULT_CONFIG + %[
|
62
76
|
item_types i:integer,s:string,t:time,b:bool,a:array
|
metadata
CHANGED
@@ -1,61 +1,65 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluent-plugin-typecast
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
version: 0.1.0
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.1
|
6
5
|
platform: ruby
|
7
|
-
authors:
|
6
|
+
authors:
|
8
7
|
- MORIYA Taro
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
dependencies:
|
16
|
-
- !ruby/object:Gem::Dependency
|
11
|
+
date: 2013-08-29 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
17
14
|
name: fluentd
|
18
|
-
requirement:
|
19
|
-
|
20
|
-
requirements:
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
21
17
|
- - ~>
|
22
|
-
- !ruby/object:Gem::Version
|
18
|
+
- !ruby/object:Gem::Version
|
23
19
|
version: 0.10.0
|
24
20
|
type: :runtime
|
25
21
|
prerelease: false
|
26
|
-
version_requirements:
|
27
|
-
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ~>
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 0.10.0
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
28
|
name: rdoc
|
29
|
-
requirement:
|
30
|
-
|
31
|
-
requirements:
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
32
31
|
- - ~>
|
33
|
-
- !ruby/object:Gem::Version
|
34
|
-
version:
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '3.12'
|
35
34
|
type: :development
|
36
35
|
prerelease: false
|
37
|
-
version_requirements:
|
38
|
-
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ~>
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '3.12'
|
41
|
+
- !ruby/object:Gem::Dependency
|
39
42
|
name: jeweler
|
40
|
-
requirement:
|
41
|
-
|
42
|
-
requirements:
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
43
45
|
- - ~>
|
44
|
-
- !ruby/object:Gem::Version
|
46
|
+
- !ruby/object:Gem::Version
|
45
47
|
version: 1.8.4
|
46
48
|
type: :development
|
47
49
|
prerelease: false
|
48
|
-
version_requirements:
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ~>
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 1.8.4
|
49
55
|
description: typecast output plugin for fluentd
|
50
56
|
email: taro.toys@gmail.com
|
51
57
|
executables: []
|
52
|
-
|
53
58
|
extensions: []
|
54
|
-
|
55
|
-
extra_rdoc_files:
|
59
|
+
extra_rdoc_files:
|
56
60
|
- LICENSE.txt
|
57
61
|
- README.rdoc
|
58
|
-
files:
|
62
|
+
files:
|
59
63
|
- .document
|
60
64
|
- Gemfile
|
61
65
|
- Gemfile.lock
|
@@ -67,36 +71,28 @@ files:
|
|
67
71
|
- lib/fluent/plugin/out_typecast.rb
|
68
72
|
- test/helper.rb
|
69
73
|
- test/plugin/test_out_typecast.rb
|
70
|
-
has_rdoc: true
|
71
74
|
homepage: http://github.com/tarom/fluent-plugin-typecast
|
72
|
-
licenses:
|
75
|
+
licenses:
|
73
76
|
- Apache License 2.0
|
77
|
+
metadata: {}
|
74
78
|
post_install_message:
|
75
79
|
rdoc_options: []
|
76
|
-
|
77
|
-
require_paths:
|
80
|
+
require_paths:
|
78
81
|
- lib
|
79
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
none: false
|
90
|
-
requirements:
|
91
|
-
- - ">="
|
92
|
-
- !ruby/object:Gem::Version
|
93
|
-
version: "0"
|
82
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
83
|
+
requirements:
|
84
|
+
- - ! '>='
|
85
|
+
- !ruby/object:Gem::Version
|
86
|
+
version: '0'
|
87
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
88
|
+
requirements:
|
89
|
+
- - ! '>='
|
90
|
+
- !ruby/object:Gem::Version
|
91
|
+
version: '0'
|
94
92
|
requirements: []
|
95
|
-
|
96
93
|
rubyforge_project:
|
97
|
-
rubygems_version:
|
94
|
+
rubygems_version: 2.0.7
|
98
95
|
signing_key:
|
99
|
-
specification_version:
|
96
|
+
specification_version: 4
|
100
97
|
summary: typecast output plugin for fluentd
|
101
98
|
test_files: []
|
102
|
-
|