fluent-plugin-rewrite 0.0.12 → 0.0.13

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9b536a9aab372542917eced071b3774a708317be
4
- data.tar.gz: d9b018a42595b8d84686d0b8d0cb8d89f486004a
3
+ metadata.gz: 40314ef9366b2cf1732c79b0e5a6ab867730442c
4
+ data.tar.gz: 7a457baa66e080cadb1abb01874eb571911a6b37
5
5
  SHA512:
6
- metadata.gz: 615dac220c4ce5d8f489cd5fa0c6d395ed384822c21e3f7db00182cb34cc8e1c0a243d729b00567b56218d23c1c0c56d5e725951912527e5a022663d9b6f2a42
7
- data.tar.gz: 40b9fb769c95e2566976cd666a2582cd30a8587da41fc4f9c5242719ec01b0b897ea2266b9eca47eb755e26df4f0adff3357c765bc1b9357a3b8615aac80b6f0
6
+ metadata.gz: 05200ecb8ae2de70ef77e99ae5e9355930516dbaa52b6fef0d8b9b1c06af7116815ee21cec74ad9cfcf6ed0d257c79f60ac39e6f4f9eef8462581930ed2da505
7
+ data.tar.gz: 323146000fbba0988f5f695643d52ded4121726edc11488ec8f06d08e38592035e811c3f8334fc4be96ef2d2c6e78af17cfdbd9a24475db49d9254a2c3c5ce26
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # fluent-plugin-rewrite
1
+ # fluent-plugin-rewrite, a plugin for [Fluentd](http://fluentd.org)
2
2
 
3
3
  ## Component
4
4
 
@@ -87,6 +87,7 @@ This time, if you want to rewrite path string along with some pattern:
87
87
  ```
88
88
 
89
89
  It executes pattern matching against a value related with `key` and replaces it with `replace` if it matches.
90
+ Need `()` in `pattern` if you want to refer values in `replace`. This is Ruby's [capturing feature](http://www.ruby-doc.org/core-2.1.1/doc/regexp_rdoc.html#label-Capturing).
90
91
 
91
92
  ```
92
93
  /foo?bar=1 -> /foo/bar/1
@@ -116,7 +117,8 @@ It executes pattern matching against a value related with `key` and skip emittin
116
117
  </rule>
117
118
  ```
118
119
 
119
- It executes pattern matching against a value related with `key` and append mathed strings to message tag. For example:
120
+ It executes pattern matching against a value related with `key` and append mathed strings to message tag.
121
+ This also need `()` to append values to tag. See [rule: replace](#rule-replace) section. For example:
120
122
 
121
123
  ```
122
124
  apache.log { "path" : "/users/antipop" }
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |gem|
2
2
  gem.name = "fluent-plugin-rewrite"
3
- gem.version = '0.0.12'
3
+ gem.version = '0.0.13'
4
4
  gem.authors = ["Kentaro Kuribayashi"]
5
5
  gem.email = ["kentarok@gmail.com"]
6
6
  gem.homepage = "http://github.com/kentaro/fluent-plugin-rewrite"
@@ -14,6 +14,7 @@ Gem::Specification.new do |gem|
14
14
  gem.require_paths = ["lib"]
15
15
 
16
16
  gem.add_development_dependency "rake"
17
+ gem.add_development_dependency "test-unit", "~> 3.1"
17
18
  gem.add_runtime_dependency "fluentd"
18
19
  end
19
20
 
@@ -2,6 +2,11 @@ module Fluent
2
2
  class RewriteOutput < Output
3
3
  Fluent::Plugin.register_output('rewrite', self)
4
4
 
5
+ # Define `router` method of v0.12 to support v0.10.57 or earlier
6
+ unless method_defined?(:router)
7
+ define_method("router") { Engine }
8
+ end
9
+
5
10
  config_param :remove_prefix, :string, :default => nil
6
11
  config_param :add_prefix, :string, :default => nil
7
12
  config_param :enable_warnings, :bool, :default => false
@@ -53,7 +58,7 @@ module Fluent
53
58
  es.each do |time, record|
54
59
  filtered_tag, record = rewrite(tag, record)
55
60
  if filtered_tag && record && _tag != filtered_tag
56
- Engine.emit(filtered_tag, time, record)
61
+ router.emit(filtered_tag, time, record)
57
62
  else
58
63
  if @enable_warnings
59
64
  $log.warn "Can not emit message because the tag(#{tag}) has not changed. Dropped record #{record}"
metadata CHANGED
@@ -1,41 +1,55 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-rewrite
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.12
4
+ version: 0.0.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kentaro Kuribayashi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-12-16 00:00:00.000000000 Z
11
+ date: 2015-10-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - '>='
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: '0'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - '>='
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: test-unit
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '3.1'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '3.1'
27
41
  - !ruby/object:Gem::Dependency
28
42
  name: fluentd
29
43
  requirement: !ruby/object:Gem::Requirement
30
44
  requirements:
31
- - - '>='
45
+ - - ">="
32
46
  - !ruby/object:Gem::Version
33
47
  version: '0'
34
48
  type: :runtime
35
49
  prerelease: false
36
50
  version_requirements: !ruby/object:Gem::Requirement
37
51
  requirements:
38
- - - '>='
52
+ - - ">="
39
53
  - !ruby/object:Gem::Version
40
54
  version: '0'
41
55
  description: Fluentd plugin to rewrite tags/values along with pattern matching and
@@ -46,7 +60,7 @@ executables: []
46
60
  extensions: []
47
61
  extra_rdoc_files: []
48
62
  files:
49
- - .gitignore
63
+ - ".gitignore"
50
64
  - Gemfile
51
65
  - LICENSE
52
66
  - README.md
@@ -65,17 +79,17 @@ require_paths:
65
79
  - lib
66
80
  required_ruby_version: !ruby/object:Gem::Requirement
67
81
  requirements:
68
- - - '>='
82
+ - - ">="
69
83
  - !ruby/object:Gem::Version
70
84
  version: '0'
71
85
  required_rubygems_version: !ruby/object:Gem::Requirement
72
86
  requirements:
73
- - - '>='
87
+ - - ">="
74
88
  - !ruby/object:Gem::Version
75
89
  version: '0'
76
90
  requirements: []
77
91
  rubyforge_project:
78
- rubygems_version: 2.0.14
92
+ rubygems_version: 2.4.5
79
93
  signing_key:
80
94
  specification_version: 4
81
95
  summary: Fluentd plugin to rewrite tags/values along with pattern matching and re-emit