fluent-plugin-grepcounter 0.4.1 → 0.4.2
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/README.md +1 -1
- data/fluent-plugin-grepcounter.gemspec +3 -3
- data/lib/fluent/plugin/out_grepcounter.rb +6 -2
- data/spec/out_grepcounter_spec.rb +2 -2
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3b6b29ceafed9d27f2a47aaae6f4509944a958c3
|
4
|
+
data.tar.gz: a7efb1d61d2a585f49a81a22b0c3d3dfa0b122f4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f6df4866a77929e798551961c6349ceb88d80b58f7959af60536b12cbcf4bd93e93311823da8abb882828f4cf6f3b313d2c50f34d682e700b6ae7f4f2054e19e
|
7
|
+
data.tar.gz: 78b66fd77923e02947ae8a1a45da3e89e5c30eba12bb96f7970a80f109f91f8956f6233c3c0e400958f2c9c8500b66f7238b6ec471f32273dd005a6c9d7f23dd
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -32,7 +32,7 @@ Then, output bocomes as belows (indented):
|
|
32
32
|
"input_tag_last":"host1",
|
33
33
|
}
|
34
34
|
|
35
|
-
###
|
35
|
+
### Output message by joining with a delimiter
|
36
36
|
|
37
37
|
As default, the `grepcounter` plugin outputs matched `message` as an array as shown above.
|
38
38
|
You may want to output `message` as a string, then use `delimiter` option like:
|
@@ -3,11 +3,11 @@ $:.push File.expand_path("../lib", __FILE__)
|
|
3
3
|
|
4
4
|
Gem::Specification.new do |s|
|
5
5
|
s.name = "fluent-plugin-grepcounter"
|
6
|
-
s.version = "0.4.
|
7
|
-
s.authors = ["Naotoshi
|
6
|
+
s.version = "0.4.2"
|
7
|
+
s.authors = ["Naotoshi Seo"]
|
8
8
|
s.email = ["sonots@gmail.com"]
|
9
9
|
s.homepage = "https://github.com/sonots/fluent-plugin-grepcounter"
|
10
|
-
s.summary = "Fluentd plugin to count the number of matched messages, and emit if
|
10
|
+
s.summary = "Fluentd plugin to count the number of matched messages, and emit if exceeds the threshold"
|
11
11
|
s.description = s.summary
|
12
12
|
s.licenses = ["MIT"]
|
13
13
|
|
@@ -19,7 +19,7 @@ class Fluent::GrepCounterOutput < Fluent::Output
|
|
19
19
|
config_param :greater_equal, :float, :default => nil
|
20
20
|
config_param :output_tag, :string, :default => nil # obsolete
|
21
21
|
config_param :tag, :string, :default => nil
|
22
|
-
config_param :add_tag_prefix, :string, :default =>
|
22
|
+
config_param :add_tag_prefix, :string, :default => nil
|
23
23
|
config_param :remove_tag_prefix, :string, :default => nil
|
24
24
|
config_param :output_with_joined_delimiter, :string, :default => nil # obsolete
|
25
25
|
config_param :delimiter, :string, :default => nil
|
@@ -83,7 +83,11 @@ class Fluent::GrepCounterOutput < Fluent::Output
|
|
83
83
|
end
|
84
84
|
end
|
85
85
|
|
86
|
-
@
|
86
|
+
if @tag.nil? and @add_tag_prefix.nil? and @remove_tag_prefix.nil?
|
87
|
+
@add_tag_prefix = 'count' # not ConfigError to support lower version compatibility
|
88
|
+
end
|
89
|
+
|
90
|
+
@tag_prefix = "#{@add_tag_prefix}." if @add_tag_prefix
|
87
91
|
@tag_prefix_match = "#{@remove_tag_prefix}." if @remove_tag_prefix
|
88
92
|
@tag_proc =
|
89
93
|
if @tag
|
@@ -282,10 +282,10 @@ describe Fluent::GrepCounterOutput do
|
|
282
282
|
end
|
283
283
|
|
284
284
|
context 'remove_tag_prefix' do
|
285
|
-
let(:config) { CONFIG + %[
|
285
|
+
let(:config) { CONFIG + %[remove_tag_prefix syslog] }
|
286
286
|
before do
|
287
287
|
Fluent::Engine.stub(:now).and_return(time)
|
288
|
-
Fluent::Engine.should_receive(:emit).with("
|
288
|
+
Fluent::Engine.should_receive(:emit).with("host1", time, expected)
|
289
289
|
end
|
290
290
|
it { emit }
|
291
291
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluent-plugin-grepcounter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
- Naotoshi
|
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
|
@@ -80,7 +80,7 @@ dependencies:
|
|
80
80
|
- - '>='
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0'
|
83
|
-
description: Fluentd plugin to count the number of matched messages, and emit if
|
83
|
+
description: Fluentd plugin to count the number of matched messages, and emit if exceeds
|
84
84
|
the threshold
|
85
85
|
email:
|
86
86
|
- sonots@gmail.com
|
@@ -125,7 +125,7 @@ rubyforge_project: fluent-plugin-grepcounter
|
|
125
125
|
rubygems_version: 2.0.3
|
126
126
|
signing_key:
|
127
127
|
specification_version: 4
|
128
|
-
summary: Fluentd plugin to count the number of matched messages, and emit if
|
128
|
+
summary: Fluentd plugin to count the number of matched messages, and emit if exceeds
|
129
129
|
the threshold
|
130
130
|
test_files:
|
131
131
|
- spec/out_grepcounter_spec.rb
|