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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 5752e71c748288a604cb0b7bb1dfafcb4acaa207
4
- data.tar.gz: 68f1c40b74c120c7aa598350f149a34bcc783ec9
2
+ SHA256:
3
+ metadata.gz: be56f82414c48bf27501fb4baf54ae7c9ab530362d9262586382dd53c4799f9e
4
+ data.tar.gz: 98eb8b9d70e65c567a0cd4f65768b9dd286b5dff7396a317fdc60bc1775113cd
5
5
  SHA512:
6
- metadata.gz: eb77d2a16a98e1a84c9a32535218be2be9074055ea91795b6b65b6fc9480ce91c188218a622a66c9bb6f7474b344517c16434cb140181f53f46f08ba4a896e2a
7
- data.tar.gz: 2fbcf475ce14c75faa8fc9364969484bc371f9c41ad403b6709b9362c4be74ced3cb70a4b834e856b52f5636f0251d661ee17737560c1911d76823bcfc916d55
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
@@ -5,8 +5,8 @@ before_install:
5
5
  rvm:
6
6
  - 2.1
7
7
  - 2.2
8
- - 2.3.3
9
- - 2.4.0
8
+ - 2.3
9
+ - 2.4.3
10
+ - 2.5.0
10
11
  gemfile:
11
- - gemfiles/fluentd_0_14.gemfile
12
12
  - Gemfile
@@ -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: [Fluentd | Configuration File | Format tips](http://docs.fluentd.org/articles/config-file#format-tips)
127
+ See also: [Config File Syntax - Fluentd](https://docs.fluentd.org/configuration/config-file#format-tips)
128
128
 
129
129
  ## Copyright
130
130
 
@@ -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.2.1"
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", [">= 0.14.0", "< 2"]
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
@@ -34,6 +34,12 @@ module Fluent::Plugin
34
34
  @map_support = Fluent::Plugin::MapSupport.new(@map, self)
35
35
  end
36
36
 
37
+ def stop
38
+ @map_support.stop
39
+
40
+ super
41
+ end
42
+
37
43
  def determine_format()
38
44
  if @format
39
45
  @format
@@ -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
- Timeout.timeout(@plugin.timeout){
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
@@ -44,6 +44,12 @@ module Fluent::Plugin
44
44
  @map_support = Fluent::Plugin::MapSupport.new(@map, self)
45
45
  end
46
46
 
47
+ def stop
48
+ @map_support.stop
49
+
50
+ super
51
+ end
52
+
47
53
  def determine_format()
48
54
  if @format
49
55
  @format
@@ -18,9 +18,9 @@ class MapFilterTest < Test::Unit::TestCase
18
18
  end
19
19
 
20
20
  def test_syntax_error
21
- tag = "tag"
22
- time = event_time('2012-10-10 10:10:10')
23
- record = {'code' => '300'}
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
- tag = "tag"
69
- record = {'code' => '300'}
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
- time = event_time('2012-10-10 10:10:10')
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
- time = event_time('2012-10-10 10:10:10')
92
- record = {'code' => '300'}
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
- time = event_time('2012-10-10 10:10:10')
106
- record = {'code' => '300'}
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 %[
@@ -50,9 +50,9 @@ class MapOutputTest < Test::Unit::TestCase
50
50
  end
51
51
 
52
52
  def test_syntax_error
53
- tag = "tag"
54
- time = event_time('2012-10-10 10:10:10')
55
- record = {'code' => '300'}
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
- tag = "tag"
120
- time = event_time('2012-10-10 10:10:10')
121
- record = {'code' => '300'}
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
- tag = "tag"
134
- record = {'code' => '300'}
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
- tag = "tag"
147
- time = Time.local(2012, 10, 10, 10, 10, 0).to_i
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
- tag = "tag"
160
- time = event_time('2012-10-10 10:10:10')
161
- record = {'code' => '300'}
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
- tag = 'tag'
176
- time = event_time('2012-10-10 10:10:10')
177
- record = {'code' => '300'}
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.2.1
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: 2017-04-25 00:00:00.000000000 Z
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: 0.14.0
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: 0.14.0
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
- rubyforge_project: fluent-plugin-map
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
@@ -1,7 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "http://rubygems.org"
4
-
5
- gem "fluentd", "~>0.14.0"
6
-
7
- gemspec :path => "../"