fluent-plugin-tag_rewrite 1.0.0 → 2.0.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: d32cd60a21f536469941e48224c67922d9bebed4
4
- data.tar.gz: e3f2591cd0299070eed310973e1e433e154f224d
2
+ SHA256:
3
+ metadata.gz: 3876d5376565faff0128d838e958cac1ccc88b490b9072a688c4fd1dfeaaf3bd
4
+ data.tar.gz: 191e0eee841e3b3de6149f0724b5a70fbdb07ed82aae27f69e03f1921f0f04cb
5
5
  SHA512:
6
- metadata.gz: 75550eb8883e152d70d504c832e332b69ff94deaef57bf8667ffe56f6eddf1cd552794a015d0e0deba718dcad2c8ee6eef729226f968eca43de42b4bbda8d6a5
7
- data.tar.gz: 3a66aab0d8cbb1186b5cf7c35626647f6c35bbc1672e1855591069fda212d3cefe1490c515c4d20b21a70b4a5c890e5cba038cdd1457a3ea5183ff2b1c598b0d
6
+ metadata.gz: 160d6a2a2152c7d4364d24d18346e3c3ad6268865906df21679aafda75e4f7a61c6e5c0e549c02a44c64066aee3952c901cf56f8e68a118b173a4c30207b835a
7
+ data.tar.gz: 3a66f4a44c7399aa29c41015c9c99d5b32c76240d1fa2bc0227485086388f9e6a6183a21e11c51d62a66dd9654c58be2dad0f9d3d88e896305a508e3d5dde377
data/.gitignore CHANGED
@@ -1,50 +1,50 @@
1
- *.gem
2
- *.rbc
3
- /.config
4
- /coverage/
5
- /InstalledFiles
6
- /pkg/
7
- /spec/reports/
8
- /spec/examples.txt
9
- /test/tmp/
10
- /test/version_tmp/
11
- /tmp/
12
-
13
- # Used by dotenv library to load environment variables.
14
- # .env
15
-
16
- ## Specific to RubyMotion:
17
- .dat*
18
- .repl_history
19
- build/
20
- *.bridgesupport
21
- build-iPhoneOS/
22
- build-iPhoneSimulator/
23
-
24
- ## Specific to RubyMotion (use of CocoaPods):
25
- #
26
- # We recommend against adding the Pods directory to your .gitignore. However
27
- # you should judge for yourself, the pros and cons are mentioned at:
28
- # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
29
- #
30
- # vendor/Pods/
31
-
32
- ## Documentation cache and generated files:
33
- /.yardoc/
34
- /_yardoc/
35
- /doc/
36
- /rdoc/
37
-
38
- ## Environment normalization:
39
- /.bundle/
40
- /vendor/bundle
41
- /lib/bundler/man/
42
-
43
- # for a library or gem, you might want to ignore these files since the code is
44
- # intended to run in multiple environments; otherwise, check them in:
45
- # Gemfile.lock
46
- # .ruby-version
47
- # .ruby-gemset
48
-
49
- # unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
50
- .rvmrc
1
+ *.gem
2
+ *.rbc
3
+ /.config
4
+ /coverage/
5
+ /InstalledFiles
6
+ /pkg/
7
+ /spec/reports/
8
+ /spec/examples.txt
9
+ /test/tmp/
10
+ /test/version_tmp/
11
+ /tmp/
12
+
13
+ # Used by dotenv library to load environment variables.
14
+ # .env
15
+
16
+ ## Specific to RubyMotion:
17
+ .dat*
18
+ .repl_history
19
+ build/
20
+ *.bridgesupport
21
+ build-iPhoneOS/
22
+ build-iPhoneSimulator/
23
+
24
+ ## Specific to RubyMotion (use of CocoaPods):
25
+ #
26
+ # We recommend against adding the Pods directory to your .gitignore. However
27
+ # you should judge for yourself, the pros and cons are mentioned at:
28
+ # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
29
+ #
30
+ # vendor/Pods/
31
+
32
+ ## Documentation cache and generated files:
33
+ /.yardoc/
34
+ /_yardoc/
35
+ /doc/
36
+ /rdoc/
37
+
38
+ ## Environment normalization:
39
+ /.bundle/
40
+ /vendor/bundle
41
+ /lib/bundler/man/
42
+
43
+ # for a library or gem, you might want to ignore these files since the code is
44
+ # intended to run in multiple environments; otherwise, check them in:
45
+ # Gemfile.lock
46
+ # .ruby-version
47
+ # .ruby-gemset
48
+
49
+ # unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
50
+ .rvmrc
data/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2019 tombola Ltd
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2019 tombola Ltd
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
data/README.md CHANGED
@@ -1,57 +1,57 @@
1
- [<img src="https://badge.fury.io/rb/fluent-plugin-tag_rewrite.png" alt="Gem Version" />](http://badge.fury.io/rb/fluent-plugin-tag_rewrite)
2
- # fluent-plugin-tag_rewrite
3
-
4
- #### Overview
5
-
6
- Rewrite tag for [Fluentd](https://www.fluentd.org). It is designed to rewrite the tags and re-emit the record with rewrited tag. Value can only be added at the start or the end of the tag.
7
-
8
- This is an output plugin because fluentd's filter doesn't allow tag rewrite.
9
-
10
- #### Installation
11
-
12
- gem install fluent-plugin-tag_rewrite
13
-
14
- #### Configuration
15
-
16
- <match **>
17
- @type tag_rewrite
18
- tag_prefix start
19
- tag_sufix end
20
- </match>
21
-
22
- Optional parameter is either tag_prefix or tag_sufix
23
-
24
- #### Example
25
- If your fluentd match configuration is the same as above followed by the match configuration like this:
26
-
27
- <match start.fluent.**>
28
- @type stdout
29
- </match>
30
-
31
- The output will be:
32
-
33
- | original record | rewritten tag record |
34
- |---------------------------------------|-------------------------------------------------|
35
- | fluent.warn {"message":"[info]: ..."} | start.fluent.warn.end {"message":"[info]: ..."} |
36
-
37
- ## Requirements
38
-
39
- | fluent-plugin-tag_rewrite | fluentd |
40
- |-------------------|---------|
41
- | >= 1.0.0 | >= v1.14.0 < 2 |
42
-
43
- #### Contributing
44
-
45
- 1. Fork it ( http://github.com/tombolaltd/fluent-plugin-tag_rewrite/fork )
46
- 2. Create your feature branch (`git checkout -b my-new-feature`)
47
- 3. Commit your changes (`git commit -am 'Add some feature'`)
48
- 4. Push to the branch (`git push origin my-new-feature`)
49
- 5. Create a new Pull Request
50
-
51
- #### Copyright
52
-
53
- Copyright (c) 2019 - [tombola](https://www.tombolaarcade.co.uk).
54
-
55
- #### License
56
-
57
- The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
1
+ [<img src="https://badge.fury.io/rb/fluent-plugin-tag_rewrite.png" alt="Gem Version" />](http://badge.fury.io/rb/fluent-plugin-tag_rewrite)
2
+ # fluent-plugin-tag_rewrite
3
+
4
+ #### Overview
5
+
6
+ Rewrite tag for [Fluentd](https://www.fluentd.org). It is designed to rewrite the tags and re-emit the record with rewritten tag. Values can only be added at the start or the end of the tag.
7
+
8
+ This is an output plugin because fluentd's filter doesn't allow tag rewriting.
9
+
10
+ #### Installation
11
+
12
+ gem install fluent-plugin-tag_rewrite
13
+
14
+ #### Configuration
15
+
16
+ <match **>
17
+ @type tag_rewrite
18
+ tag_prefix start
19
+ tag_suffix end
20
+ </match>
21
+
22
+ You must provide at least one of tag_prefix or tag_suffix
23
+
24
+ #### Example
25
+ If your fluentd match configuration is the same as above followed by a match configuration like this:
26
+
27
+ <match start.fluent.**>
28
+ @type stdout
29
+ </match>
30
+
31
+ The output will be:
32
+
33
+ | original record | rewritten tag record |
34
+ |---------------------------------------|-------------------------------------------------|
35
+ | fluent.warn {"message":"[info]: ..."} | start.fluent.warn.end {"message":"[info]: ..."} |
36
+
37
+ ## Requirements
38
+
39
+ | fluent-plugin-tag_rewrite | fluentd |
40
+ |-------------------|---------|
41
+ | >= 1.0.0 | >= v1.14.0 < 2 |
42
+
43
+ #### Contributing
44
+
45
+ 1. Fork it ( http://github.com/tombolaltd/fluent-plugin-tag_rewrite/fork )
46
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
47
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
48
+ 4. Push to the branch (`git push origin my-new-feature`)
49
+ 5. Create a new Pull Request
50
+
51
+ #### Copyright
52
+
53
+ Copyright (c) 2019 - [tombola](https://www.tombolaarcade.co.uk).
54
+
55
+ #### License
56
+
57
+ The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
@@ -1,17 +1,17 @@
1
- # encoding: utf-8
2
- Gem::Specification.new do |gem|
3
- gem.name = "fluent-plugin-tag_rewrite"
4
- gem.description = "This input plugin allows you rewrite tag"
5
- gem.homepage = "https://github.com/tombolaltd/fluent-plugin-tag_rewrite"
6
- gem.summary = gem.description
7
- gem.version = "1.0.0"
8
- gem.license = 'MIT'
9
- gem.authors = ["Sohaib Maroof"]
10
- gem.email = "sohaib.maroof@tombola.com"
11
- gem.has_rdoc = false
12
- gem.files = `git ls-files`.split("\n")
13
- gem.require_paths = ['lib']
14
- gem.add_runtime_dependency "fluentd", [">= 0.14.0", "< 2"]
15
- end
16
-
17
-
1
+ # encoding: utf-8
2
+ Gem::Specification.new do |gem|
3
+ gem.name = "fluent-plugin-tag_rewrite"
4
+ gem.description = "This input plugin allows you rewrite tag"
5
+ gem.homepage = "https://github.com/tombolaltd/fluent-plugin-tag_rewrite"
6
+ gem.summary = gem.description
7
+ gem.version = "2.0.0"
8
+ gem.license = 'MIT'
9
+ gem.authors = ["Sohaib Maroof"]
10
+ gem.email = "sohaib.maroof@tombola.com"
11
+ gem.has_rdoc = false
12
+ gem.files = `git ls-files`.split("\n")
13
+ gem.require_paths = ['lib']
14
+ gem.add_runtime_dependency "fluentd", [">= 0.14.0", "< 2"]
15
+ end
16
+
17
+
@@ -1,40 +1,40 @@
1
- require "fluent/plugin/output"
2
-
3
- class Fluent::Plugin::TagRewriteOutput < Fluent::Plugin::Output
4
- Fluent::Plugin.register_output("tag_rewrite", self)
5
-
6
- helpers :event_emitter
7
-
8
- config_param :tag_prefix, :string, :default => nil
9
- config_param :tag_sufix, :string, :default => nil
10
-
11
- def configure(conf)
12
- super
13
-
14
- if @tag_prefix.nil? && @tag_prefix.nil?
15
- raise Fluent::ConfigError, "tag_prefix or tag_sufix has not been provided"
16
- end
17
- end
18
-
19
- def multi_workers_ready?
20
- true
21
- end
22
-
23
- def process(tag, es)
24
- es.each do |time, record|
25
- begin
26
- rewrited_tag = tag
27
- unless @tag_prefix.nil?
28
- rewrited_tag = @tag_prefix + "." + rewrited_tag
29
- end
30
- unless @tag_sufix.nil?
31
- rewrited_tag = rewrited_tag + "." + @tag_sufix
32
- end
33
- router.emit(rewrited_tag, time, record)
34
- rescue
35
- $log.error("unexpected error in append_tag", :error => $!.to_s)
36
- $log.error_backtrace
37
- end
38
- end
39
- end
40
- end
1
+ require "fluent/plugin/output"
2
+
3
+ class Fluent::Plugin::TagRewriteOutput < Fluent::Plugin::Output
4
+ Fluent::Plugin.register_output("tag_rewrite", self)
5
+
6
+ helpers :event_emitter
7
+
8
+ config_param :tag_prefix, :string, :default => nil
9
+ config_param :tag_suffix, :string, :default => nil
10
+
11
+ def configure(conf)
12
+ super
13
+
14
+ if @tag_prefix.nil? && @tag_prefix.nil?
15
+ raise Fluent::ConfigError, "Neither tag_prefix nor tag_suffix has not been provided"
16
+ end
17
+ end
18
+
19
+ def multi_workers_ready?
20
+ true
21
+ end
22
+
23
+ def process(tag, es)
24
+ es.each do |time, record|
25
+ begin
26
+ rewritten_tag = tag
27
+ unless @tag_prefix.nil?
28
+ rewritten_tag = @tag_prefix + "." + rewritten_tag
29
+ end
30
+ unless @tag_suffix.nil?
31
+ rewritten_tag = rewritten_tag + "." + @tag_suffix
32
+ end
33
+ router.emit(rewritten_tag, time, record)
34
+ rescue
35
+ $log.error("unexpected error in tag_rewrite", :error => $!.to_s)
36
+ $log.error_backtrace
37
+ end
38
+ end
39
+ end
40
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-tag_rewrite
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sohaib Maroof
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-03-18 00:00:00.000000000 Z
11
+ date: 2019-03-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fluentd
@@ -61,7 +61,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
61
61
  version: '0'
62
62
  requirements: []
63
63
  rubyforge_project:
64
- rubygems_version: 2.5.2.3
64
+ rubygems_version: 2.7.6
65
65
  signing_key:
66
66
  specification_version: 4
67
67
  summary: This input plugin allows you rewrite tag