fluent-plugin-grep 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/fluent-plugin-grep.gemspec +1 -1
- data/lib/fluent/plugin/out_grep.rb +7 -3
- data/spec/out_grep_spec.rb +1 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2e382e08c49b5adc65ff681356c292423a90eff1
|
4
|
+
data.tar.gz: 6eeb7e28f4e75a25a15ff816299062625fa5939d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eb7f1ab442ae55877b383bfacb4e8b44d723052574fdd4d870f3c32b10ca19b209a8749eeb641779cbbc9f6851167586f97b9c0f487fdf2f9d63303ea7b1c912
|
7
|
+
data.tar.gz: 959c770dbfc9dc31326f311c1ade4d9c85b6831a3a192dcece72d17aa7ba951e53a9dbc8eec7f91a80a4ececa3c216be7bb7b2f18cc03e6dcfabe77c4d8c26d3
|
data/CHANGELOG.md
CHANGED
data/fluent-plugin-grep.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-grep"
|
6
|
-
s.version = "0.2.
|
6
|
+
s.version = "0.2.1"
|
7
7
|
s.authors = ["Naotoshi Seo"]
|
8
8
|
s.email = ["sonots@gmail.com"]
|
9
9
|
s.homepage = "https://github.com/sonots/fluent-plugin-grep"
|
@@ -5,7 +5,7 @@ class Fluent::GrepOutput < Fluent::Output
|
|
5
5
|
config_param :regexp, :string, :default => nil
|
6
6
|
config_param :exclude, :string, :default => nil
|
7
7
|
config_param :tag, :string, :default => nil
|
8
|
-
config_param :add_tag_prefix, :string, :default =>
|
8
|
+
config_param :add_tag_prefix, :string, :default => nil
|
9
9
|
config_param :remove_tag_prefix, :string, :default => nil
|
10
10
|
config_param :replace_invalid_sequence, :bool, :default => false
|
11
11
|
|
@@ -15,9 +15,13 @@ class Fluent::GrepOutput < Fluent::Output
|
|
15
15
|
@input_key = @input_key.to_s
|
16
16
|
@regexp = Regexp.compile(@regexp) if @regexp
|
17
17
|
@exclude = Regexp.compile(@exclude) if @exclude
|
18
|
-
@tag_prefix = "#{@add_tag_prefix}."
|
19
|
-
@tag_prefix_match = "#{@remove_tag_prefix}." if @remove_tag_prefix
|
20
18
|
|
19
|
+
if @tag.nil? and @add_tag_prefix.nil? and @remove_tag_prefix.nil?
|
20
|
+
@add_tag_prefix = 'greped' # not ConfigError to support lower version compatibility
|
21
|
+
end
|
22
|
+
|
23
|
+
@tag_prefix = "#{@add_tag_prefix}." if @add_tag_prefix
|
24
|
+
@tag_prefix_match = "#{@remove_tag_prefix}." if @remove_tag_prefix
|
21
25
|
@tag_proc =
|
22
26
|
if @tag
|
23
27
|
Proc.new {|tag| @tag }
|
data/spec/out_grep_spec.rb
CHANGED
@@ -119,13 +119,12 @@ describe Fluent::GrepOutput do
|
|
119
119
|
let(:config) do
|
120
120
|
CONFIG + %[
|
121
121
|
regexp ping
|
122
|
-
add_tag_prefix foo
|
123
122
|
remove_tag_prefix syslog
|
124
123
|
]
|
125
124
|
end
|
126
125
|
before do
|
127
126
|
Fluent::Engine.stub(:now).and_return(time)
|
128
|
-
Fluent::Engine.should_receive(:emit).with("
|
127
|
+
Fluent::Engine.should_receive(:emit).with("host1", time, {'foo'=>'bar', 'message'=>"2013/01/13T07:02:11.124202 INFO GET /ping"})
|
129
128
|
end
|
130
129
|
it { emit }
|
131
130
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluent-plugin-grep
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Naotoshi Seo
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-12-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fluentd
|