fluent-plugin-grepcounter 0.1.0.pre → 0.1.1
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 +4 -4
- data/CHANGELOG.md +7 -1
- data/README.md +14 -4
- data/fluent-plugin-grepcounter.gemspec +1 -1
- data/lib/fluent/plugin/out_grepcounter.rb +2 -2
- data/spec/out_grepcounter_spec.rb +2 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6e975b60c3a77833ed72a229d79c7c0cc64efa5a
|
4
|
+
data.tar.gz: 2aa97645c4645e08b2d0ce5cb0fc6576a688b53c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: df73667b60738771cc4adb82d4e79dc48defd6f9b8db5056787b0e71721cb897065b69bf71a6bc3cd50414ece433d718aecbf8dde8de7685ea19cd150cfc6dfe
|
7
|
+
data.tar.gz: d70577b7bd642a1360b57b91a92f716cb4b470f3e26cd26fe68566ef1bf57536b827824cdb01a33ede8a0816862c86ef53d69de00a82c91606db61390ad7d1f0
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -23,9 +23,14 @@ An example of grepcounter configuration:
|
|
23
23
|
add_tag_prefix warn.count
|
24
24
|
</source>
|
25
25
|
|
26
|
-
Then, output bocomes as belows:
|
26
|
+
Then, output bocomes as belows (indented):
|
27
27
|
|
28
|
-
warn.count.syslog.host1: {
|
28
|
+
warn.count.syslog.host1: {
|
29
|
+
"count":2,
|
30
|
+
"message":["2013/01/13T07:02:13.232645 WARN POST /auth","2013/01/13T07:02:43.632145 WARN POST /login"],
|
31
|
+
"input_tag":"syslog.host1",
|
32
|
+
"input_tag_last":"host1",
|
33
|
+
}
|
29
34
|
|
30
35
|
Another example of grepcounter configuration to use `output_delimiter`:
|
31
36
|
|
@@ -40,9 +45,14 @@ Another example of grepcounter configuration to use `output_delimiter`:
|
|
40
45
|
output_delimiter \n
|
41
46
|
</source>
|
42
47
|
|
43
|
-
Then, output bocomes as belows. You can use the `message` field is joined with \n.
|
48
|
+
Then, output bocomes as belows (indented). You can use the `message` field is joined with \n.
|
44
49
|
|
45
|
-
warn.count.syslog.host1: {
|
50
|
+
warn.count.syslog.host1: {
|
51
|
+
"count":2,
|
52
|
+
"message":"2013/01/13T07:02:13.232645 WARN POST /auth\n2013/01/13T07:02:43.632145 WARN POST /login",
|
53
|
+
"input_tag":"syslog.host1",
|
54
|
+
"input_tag_last":"host1",
|
55
|
+
}
|
46
56
|
|
47
57
|
## Parameters
|
48
58
|
|
@@ -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-grepcounter"
|
6
|
-
s.version = "0.1.
|
6
|
+
s.version = "0.1.1"
|
7
7
|
s.authors = ["Naotoshi SEO"]
|
8
8
|
s.email = ["sonots@gmail.com"]
|
9
9
|
s.homepage = "https://github.com/sonots/fluent-plugin-grepcounter"
|
@@ -9,7 +9,7 @@ class Fluent::GrepCounterOutput < Fluent::Output
|
|
9
9
|
config_param :threshold, :integer, :default => 1
|
10
10
|
config_param :output_tag, :string, :default => nil
|
11
11
|
config_param :add_tag_prefix, :string, :default => 'count'
|
12
|
-
config_param :
|
12
|
+
config_param :output_with_joined_delimiter, :string, :default => nil
|
13
13
|
config_param :aggregate, :string, :default => 'tag'
|
14
14
|
|
15
15
|
attr_accessor :matches
|
@@ -115,7 +115,7 @@ class Fluent::GrepCounterOutput < Fluent::Output
|
|
115
115
|
return nil if count < @threshold
|
116
116
|
output = {}
|
117
117
|
output['count'] = count
|
118
|
-
output['message'] = @
|
118
|
+
output['message'] = @output_with_joined_delimiter.nil? ? matches : matches.join(@output_with_joined_delimiter)
|
119
119
|
if tag
|
120
120
|
output['input_tag'] = tag
|
121
121
|
output['input_tag_last'] = tag.split('.').last
|
@@ -182,12 +182,12 @@ describe Fluent::GrepCounterOutput do
|
|
182
182
|
it { emit }
|
183
183
|
end
|
184
184
|
|
185
|
-
context '
|
185
|
+
context 'output_with_joined_delimiter' do
|
186
186
|
let(:config) do
|
187
187
|
# \\n shall be \n in config file
|
188
188
|
CONFIG + %[
|
189
189
|
regexp WARN
|
190
|
-
|
190
|
+
output_with_joined_delimiter \\n
|
191
191
|
]
|
192
192
|
end
|
193
193
|
before do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluent-plugin-grepcounter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Naotoshi SEO
|
@@ -115,9 +115,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
115
115
|
version: '0'
|
116
116
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
117
117
|
requirements:
|
118
|
-
- - '
|
118
|
+
- - '>='
|
119
119
|
- !ruby/object:Gem::Version
|
120
|
-
version:
|
120
|
+
version: '0'
|
121
121
|
requirements: []
|
122
122
|
rubyforge_project: fluent-plugin-grepcounter
|
123
123
|
rubygems_version: 2.0.0
|