fluent-plugin-time_parser 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +1 -1
- data/README.md +12 -6
- data/fluent-plugin-time_parser.gemspec +3 -3
- data/test/plugin/test_out_time_parser.rb +6 -4
- metadata +4 -2
data/.gitignore
CHANGED
data/README.md
CHANGED
@@ -22,19 +22,21 @@ And you feed such a value into fluentd:
|
|
22
22
|
|
23
23
|
```
|
24
24
|
"test" => {
|
25
|
-
"time" => "
|
25
|
+
"time" => "2013-05-14T15:14:36Z"
|
26
26
|
}
|
27
27
|
```
|
28
28
|
|
29
|
-
Then you'll get re-emmited
|
29
|
+
Then you'll get re-emmited tags/records like so:
|
30
30
|
|
31
31
|
```
|
32
32
|
"extracted.test" => {
|
33
|
-
"time" => "2013-
|
34
|
-
"
|
35
|
-
"
|
33
|
+
"time" => "2013-05-14T15:14:36Z",
|
34
|
+
"parsed_time" => "2013-05-15T00:14:36+09:00",
|
35
|
+
"parsed_date" => "2013-05-15",
|
36
|
+
"parsed_hour" => "0"
|
36
37
|
}
|
37
38
|
```
|
39
|
+
|
38
40
|
## Configuration
|
39
41
|
|
40
42
|
### key
|
@@ -49,7 +51,11 @@ You must add at least one of these params.
|
|
49
51
|
|
50
52
|
### time_zone
|
51
53
|
|
52
|
-
time_parser
|
54
|
+
Necessary. time_parser uses the TZInfo (http://tzinfo.rubyforge.org/) library to handle time zones.
|
55
|
+
|
56
|
+
### parsed_time_tag, parsed_hour_tag, parsed_date_tag
|
57
|
+
|
58
|
+
The parsed_* parameter names can be configured as well.
|
53
59
|
|
54
60
|
## Installation
|
55
61
|
|
@@ -1,8 +1,8 @@
|
|
1
1
|
Gem::Specification.new do |gem|
|
2
2
|
gem.name = 'fluent-plugin-time_parser'
|
3
|
-
gem.version = '0.0.
|
4
|
-
gem.authors = ['Carlos Donderis']
|
5
|
-
gem.email = ['cdonderis@gmail.com']
|
3
|
+
gem.version = '0.0.4'
|
4
|
+
gem.authors = ['Carlos Donderis', 'Michael H. Oshita']
|
5
|
+
gem.email = ['cdonderis@gmail.com', 'ijinpublic+github@gmail.com']
|
6
6
|
gem.homepage = 'http://github.com/cads/fluent-plugin-time_parser'
|
7
7
|
gem.description = %q{Fluentd plugin to parse the time parameter.}
|
8
8
|
gem.summary = %q{Fluentd plugin to parse the time parameter.}
|
@@ -6,7 +6,7 @@ require 'tzinfo'
|
|
6
6
|
class TimeParserOutputTest < Test::Unit::TestCase
|
7
7
|
|
8
8
|
TIME = "2013-04-14T06:14:36Z"
|
9
|
-
GIRIGIRI_TIME = "2013-
|
9
|
+
GIRIGIRI_TIME = "2013-05-14T15:14:36Z"
|
10
10
|
|
11
11
|
def setup
|
12
12
|
Fluent::Test.setup
|
@@ -62,6 +62,7 @@ class TimeParserOutputTest < Test::Unit::TestCase
|
|
62
62
|
record = {'time' => TIME}
|
63
63
|
d.instance.filter_record('test', Time.now, record)
|
64
64
|
|
65
|
+
assert_equal record['time'], TIME
|
65
66
|
assert_equal record['parsed_time'], "2013-04-14T15:14:36+09:00"
|
66
67
|
assert_equal record['parsed_date'], "2013-04-14"
|
67
68
|
assert_equal record['parsed_hour'], "15"
|
@@ -77,8 +78,9 @@ class TimeParserOutputTest < Test::Unit::TestCase
|
|
77
78
|
record = {'time' => GIRIGIRI_TIME}
|
78
79
|
d.instance.filter_record('test', Time.now, record)
|
79
80
|
|
80
|
-
assert_equal record['
|
81
|
-
assert_equal record['
|
81
|
+
assert_equal record['time'], GIRIGIRI_TIME
|
82
|
+
assert_equal record['parsed_time'], "2013-05-15T00:14:36+09:00"
|
83
|
+
assert_equal record['parsed_date'], "2013-05-15"
|
82
84
|
assert_equal record['parsed_hour'], "0"
|
83
85
|
end
|
84
86
|
|
@@ -154,4 +156,4 @@ class TimeParserOutputTest < Test::Unit::TestCase
|
|
154
156
|
assert_equal wrong_time, emits[0][2]['time']
|
155
157
|
end
|
156
158
|
|
157
|
-
end
|
159
|
+
end
|
metadata
CHANGED
@@ -1,11 +1,12 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluent-plugin-time_parser
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Carlos Donderis
|
9
|
+
- Michael H. Oshita
|
9
10
|
autorequire:
|
10
11
|
bindir: bin
|
11
12
|
cert_chain: []
|
@@ -94,6 +95,7 @@ dependencies:
|
|
94
95
|
description: Fluentd plugin to parse the time parameter.
|
95
96
|
email:
|
96
97
|
- cdonderis@gmail.com
|
98
|
+
- ijinpublic+github@gmail.com
|
97
99
|
executables: []
|
98
100
|
extensions: []
|
99
101
|
extra_rdoc_files: []
|
@@ -127,7 +129,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
127
129
|
version: '0'
|
128
130
|
requirements: []
|
129
131
|
rubyforge_project:
|
130
|
-
rubygems_version: 1.8.
|
132
|
+
rubygems_version: 1.8.24
|
131
133
|
signing_key:
|
132
134
|
specification_version: 3
|
133
135
|
summary: Fluentd plugin to parse the time parameter.
|