fluent-plugin-map 0.2.1 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/.github/ISSUE_TEMPLATE.md +19 -0
- data/.travis.yml +3 -3
- data/README.markdown +1 -1
- data/fluent-plugin-map.gemspec +2 -2
- data/lib/fluent/plugin/filter_map.rb +6 -0
- data/lib/fluent/plugin/map_support.rb +10 -1
- data/lib/fluent/plugin/out_map.rb +6 -0
- data/test/plugin/test_filter_map.rb +10 -10
- data/test/plugin/test_out_map.rb +16 -16
- metadata +6 -7
- data/gemfiles/fluentd_0_14.gemfile +0 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: be56f82414c48bf27501fb4baf54ae7c9ab530362d9262586382dd53c4799f9e
|
4
|
+
data.tar.gz: 98eb8b9d70e65c567a0cd4f65768b9dd286b5dff7396a317fdc60bc1775113cd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aa4f2733d31394ceddb2e563261455ef156e74644a2c9f2af70fe8f91ef95f07b412f41829b683f07212bb4195a6488c0dd25cd260413ee6a01d6b99dc41c761
|
7
|
+
data.tar.gz: d1872e4817788d33fad7883465dd1af3e39f0de75f7c48dc82854eb7edc5484bf6f9e3335489bba00aa74c1b75260276800b3ad1c5cd03a5297dcefa61b1dc09
|
@@ -0,0 +1,19 @@
|
|
1
|
+
#### Problem
|
2
|
+
|
3
|
+
...
|
4
|
+
|
5
|
+
#### Steps to replicate
|
6
|
+
|
7
|
+
Provide example config and message
|
8
|
+
|
9
|
+
#### Expected Behavior
|
10
|
+
|
11
|
+
...
|
12
|
+
|
13
|
+
#### Your environment
|
14
|
+
|
15
|
+
* OS version
|
16
|
+
* paste result of ``fluentd --version`` or ``td-agent --version``
|
17
|
+
* plugin version
|
18
|
+
* paste boot log of fluentd or td-agent
|
19
|
+
* paste result of ``fluent-gem list``, ``td-agent-gem list`` or your Gemfile.lock
|
data/.travis.yml
CHANGED
data/README.markdown
CHANGED
@@ -124,7 +124,7 @@ If you don't use multi option, you can use key, time, record parameter. The 2 fo
|
|
124
124
|
## Note
|
125
125
|
|
126
126
|
you have to wrap some configuration values with parenthesis like `("code." + tag)`, to avoid parsing by Fluentd itself.
|
127
|
-
See also: [
|
127
|
+
See also: [Config File Syntax - Fluentd](https://docs.fluentd.org/configuration/config-file#format-tips)
|
128
128
|
|
129
129
|
## Copyright
|
130
130
|
|
data/fluent-plugin-map.gemspec
CHANGED
@@ -3,7 +3,7 @@ $:.push File.expand_path("../lib", __FILE__)
|
|
3
3
|
|
4
4
|
Gem::Specification.new do |s|
|
5
5
|
s.name = "fluent-plugin-map"
|
6
|
-
s.version = "0.
|
6
|
+
s.version = "0.3.0"
|
7
7
|
s.authors = ["Kohei Tomita", "Hiroshi Hatake", "Kenji Okomoto"]
|
8
8
|
s.email = ["tommy.fmale@gmail.com", "cosmo0920.oucc@gmail.com", "okkez000@gmail.com"]
|
9
9
|
s.homepage = "https://github.com/fluent-plugins-nursery/fluent-plugin-map"
|
@@ -19,7 +19,7 @@ Gem::Specification.new do |s|
|
|
19
19
|
s.license = "Apache-2.0"
|
20
20
|
|
21
21
|
s.add_development_dependency "rake"
|
22
|
-
s.add_development_dependency "fluentd", [">=
|
22
|
+
s.add_development_dependency "fluentd", [">= 1.7.0", "< 2"]
|
23
23
|
s.add_development_dependency "test-unit", "~> 3.1"
|
24
24
|
s.add_development_dependency "appraisal"
|
25
25
|
end
|
@@ -14,12 +14,17 @@
|
|
14
14
|
# limitations under the License.
|
15
15
|
#
|
16
16
|
|
17
|
+
require 'fluent/plugin/parser'
|
18
|
+
|
17
19
|
module Fluent
|
18
20
|
module Plugin
|
19
21
|
class MapSupport
|
20
22
|
def initialize(map, plugin)
|
21
23
|
@map = map
|
22
24
|
@plugin = plugin
|
25
|
+
@checker = Fluent::Plugin::Parser::TimeoutChecker.new(@plugin.timeout)
|
26
|
+
@checker.start
|
27
|
+
|
23
28
|
if plugin.is_a?(Fluent::Plugin::Filter)
|
24
29
|
singleton_class.module_eval(<<-CODE)
|
25
30
|
def map_func(time, record)
|
@@ -103,13 +108,17 @@ module Fluent
|
|
103
108
|
|
104
109
|
def timeout_block
|
105
110
|
begin
|
106
|
-
|
111
|
+
@checker.execute {
|
107
112
|
yield
|
108
113
|
}
|
109
114
|
rescue Timeout::Error
|
110
115
|
@plugin.log.error {"Timeout: #{Time.at(time)} #{tag} #{record.inspect}"}
|
111
116
|
end
|
112
117
|
end
|
118
|
+
|
119
|
+
def stop
|
120
|
+
@checker.stop
|
121
|
+
end
|
113
122
|
end
|
114
123
|
end
|
115
124
|
end
|
@@ -18,9 +18,9 @@ class MapFilterTest < Test::Unit::TestCase
|
|
18
18
|
end
|
19
19
|
|
20
20
|
def test_syntax_error
|
21
|
-
|
22
|
-
|
23
|
-
|
21
|
+
_tag = "tag"
|
22
|
+
_time = event_time('2012-10-10 10:10:10')
|
23
|
+
_record = {'code' => '300'}
|
24
24
|
|
25
25
|
#map is syntax error
|
26
26
|
syntax_error_config = %[
|
@@ -65,8 +65,8 @@ class MapFilterTest < Test::Unit::TestCase
|
|
65
65
|
|
66
66
|
#deprected specification test
|
67
67
|
def test_config_error_time
|
68
|
-
|
69
|
-
|
68
|
+
_tag = "tag"
|
69
|
+
_record = {'code' => '300'}
|
70
70
|
|
71
71
|
#require time
|
72
72
|
assert_raise(Fluent::ConfigError){
|
@@ -77,7 +77,7 @@ class MapFilterTest < Test::Unit::TestCase
|
|
77
77
|
end
|
78
78
|
|
79
79
|
def test_config_error_record
|
80
|
-
|
80
|
+
_time = event_time('2012-10-10 10:10:10')
|
81
81
|
|
82
82
|
#require record
|
83
83
|
assert_raise(Fluent::ConfigError){
|
@@ -88,8 +88,8 @@ class MapFilterTest < Test::Unit::TestCase
|
|
88
88
|
end
|
89
89
|
|
90
90
|
def test_config_error_multi
|
91
|
-
|
92
|
-
|
91
|
+
_time = event_time('2012-10-10 10:10:10')
|
92
|
+
_record = {'code' => '300'}
|
93
93
|
|
94
94
|
#require time
|
95
95
|
assert_raise(Fluent::ConfigError){
|
@@ -102,8 +102,8 @@ class MapFilterTest < Test::Unit::TestCase
|
|
102
102
|
end
|
103
103
|
|
104
104
|
def test_config_error_sleep
|
105
|
-
|
106
|
-
|
105
|
+
_time = event_time('2012-10-10 10:10:10')
|
106
|
+
_record = {'code' => '300'}
|
107
107
|
|
108
108
|
assert_raise(SyntaxError) {
|
109
109
|
create_driver %[
|
data/test/plugin/test_out_map.rb
CHANGED
@@ -50,9 +50,9 @@ class MapOutputTest < Test::Unit::TestCase
|
|
50
50
|
end
|
51
51
|
|
52
52
|
def test_syntax_error
|
53
|
-
|
54
|
-
|
55
|
-
|
53
|
+
_tag = "tag"
|
54
|
+
_time = event_time('2012-10-10 10:10:10')
|
55
|
+
_record = {'code' => '300'}
|
56
56
|
|
57
57
|
#map is syntax error
|
58
58
|
syntax_error_config = %[
|
@@ -116,9 +116,9 @@ class MapOutputTest < Test::Unit::TestCase
|
|
116
116
|
end
|
117
117
|
|
118
118
|
def test_config_error_tag
|
119
|
-
|
120
|
-
|
121
|
-
|
119
|
+
_tag = "tag"
|
120
|
+
_time = event_time('2012-10-10 10:10:10')
|
121
|
+
_record = {'code' => '300'}
|
122
122
|
|
123
123
|
#require time
|
124
124
|
assert_raise(Fluent::ConfigError){
|
@@ -130,8 +130,8 @@ class MapOutputTest < Test::Unit::TestCase
|
|
130
130
|
end
|
131
131
|
|
132
132
|
def test_config_error_time
|
133
|
-
|
134
|
-
|
133
|
+
_tag = "tag"
|
134
|
+
_record = {'code' => '300'}
|
135
135
|
|
136
136
|
#require time
|
137
137
|
assert_raise(Fluent::ConfigError){
|
@@ -143,8 +143,8 @@ class MapOutputTest < Test::Unit::TestCase
|
|
143
143
|
end
|
144
144
|
|
145
145
|
def test_config_error_record
|
146
|
-
|
147
|
-
|
146
|
+
_tag = "tag"
|
147
|
+
_time = Time.local(2012, 10, 10, 10, 10, 0).to_i
|
148
148
|
|
149
149
|
#require record
|
150
150
|
assert_raise(Fluent::ConfigError){
|
@@ -156,9 +156,9 @@ class MapOutputTest < Test::Unit::TestCase
|
|
156
156
|
end
|
157
157
|
|
158
158
|
def test_config_error_multi
|
159
|
-
|
160
|
-
|
161
|
-
|
159
|
+
_tag = "tag"
|
160
|
+
_time = event_time('2012-10-10 10:10:10')
|
161
|
+
_record = {'code' => '300'}
|
162
162
|
|
163
163
|
#require time
|
164
164
|
assert_raise(Fluent::ConfigError){
|
@@ -172,9 +172,9 @@ class MapOutputTest < Test::Unit::TestCase
|
|
172
172
|
end
|
173
173
|
|
174
174
|
def test_config_error_sleep
|
175
|
-
|
176
|
-
|
177
|
-
|
175
|
+
_tag = 'tag'
|
176
|
+
_time = event_time('2012-10-10 10:10:10')
|
177
|
+
_record = {'code' => '300'}
|
178
178
|
|
179
179
|
assert_raise(SyntaxError) {
|
180
180
|
create_driver %[
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluent-plugin-map
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kohei Tomita
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date:
|
13
|
+
date: 2020-06-19 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rake
|
@@ -32,7 +32,7 @@ dependencies:
|
|
32
32
|
requirements:
|
33
33
|
- - ">="
|
34
34
|
- !ruby/object:Gem::Version
|
35
|
-
version:
|
35
|
+
version: 1.7.0
|
36
36
|
- - "<"
|
37
37
|
- !ruby/object:Gem::Version
|
38
38
|
version: '2'
|
@@ -42,7 +42,7 @@ dependencies:
|
|
42
42
|
requirements:
|
43
43
|
- - ">="
|
44
44
|
- !ruby/object:Gem::Version
|
45
|
-
version:
|
45
|
+
version: 1.7.0
|
46
46
|
- - "<"
|
47
47
|
- !ruby/object:Gem::Version
|
48
48
|
version: '2'
|
@@ -84,6 +84,7 @@ executables: []
|
|
84
84
|
extensions: []
|
85
85
|
extra_rdoc_files: []
|
86
86
|
files:
|
87
|
+
- ".github/ISSUE_TEMPLATE.md"
|
87
88
|
- ".gitignore"
|
88
89
|
- ".travis.yml"
|
89
90
|
- Appraisals
|
@@ -92,7 +93,6 @@ files:
|
|
92
93
|
- README.markdown
|
93
94
|
- Rakefile
|
94
95
|
- fluent-plugin-map.gemspec
|
95
|
-
- gemfiles/fluentd_0_14.gemfile
|
96
96
|
- lib/fluent/plugin/filter_map.rb
|
97
97
|
- lib/fluent/plugin/map_config_param.rb
|
98
98
|
- lib/fluent/plugin/map_support.rb
|
@@ -120,8 +120,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
120
120
|
- !ruby/object:Gem::Version
|
121
121
|
version: '0'
|
122
122
|
requirements: []
|
123
|
-
|
124
|
-
rubygems_version: 2.5.2
|
123
|
+
rubygems_version: 3.0.3
|
125
124
|
signing_key:
|
126
125
|
specification_version: 4
|
127
126
|
summary: fluent-plugin-map is the non-buffered plugin that can convert an event log
|