fluent-plugin-datacounter 0.4.4 → 0.4.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +3 -1
- data/fluent-plugin-datacounter.gemspec +2 -2
- data/lib/fluent/plugin/out_datacounter.rb +33 -15
- 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: 4cfe9eca2a4e10f492885b664bacc09ad0b7778b
|
4
|
+
data.tar.gz: 3830e5d5e8d337cb69c68b1498616c9db434693c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0db6a72abf014b2cc6ba7a4910774cd757e68552068500b31b0d02245371ecda00c2cbd1d2573bc1acef60ebc75462a9dab190f73ef9017ca1ce77d2de09c560
|
7
|
+
data.tar.gz: bfb3bad278d68359493f2cf1a431e0870691d92fa11aab3317f6004ad9feccfc3abee5dc77382c48d6395d987db14b933c7f3629659b382c516fee3f891366e1
|
data/.travis.yml
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
2
|
Gem::Specification.new do |gem|
|
3
3
|
gem.name = "fluent-plugin-datacounter"
|
4
|
-
gem.version = "0.4.
|
4
|
+
gem.version = "0.4.5"
|
5
5
|
gem.authors = ["TAGOMORI Satoshi"]
|
6
6
|
gem.email = ["tagomoris@gmail.com"]
|
7
7
|
gem.homepage = "https://github.com/tagomoris/fluent-plugin-datacounter"
|
8
8
|
gem.summary = %q{Fluentd plugin to count records with specified regexp patterns}
|
9
9
|
gem.description = %q{To count records with string fields by regexps (To count records with numbers, use numeric-counter)}
|
10
|
-
gem.license = "
|
10
|
+
gem.license = "Apache-2.0"
|
11
11
|
|
12
12
|
gem.files = `git ls-files`.split("\n")
|
13
13
|
gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
@@ -6,6 +6,11 @@ class Fluent::DataCounterOutput < Fluent::Output
|
|
6
6
|
define_method("log") { $log }
|
7
7
|
end
|
8
8
|
|
9
|
+
# Define `router` method of v0.12 to support v0.10 or earlier
|
10
|
+
unless method_defined?(:router)
|
11
|
+
define_method("router") { Fluent::Engine }
|
12
|
+
end
|
13
|
+
|
9
14
|
def initialize
|
10
15
|
super
|
11
16
|
require 'pathname'
|
@@ -13,22 +18,35 @@ class Fluent::DataCounterOutput < Fluent::Output
|
|
13
18
|
|
14
19
|
PATTERN_MAX_NUM = 20
|
15
20
|
|
16
|
-
config_param :count_interval, :time, :default => nil
|
17
|
-
|
18
|
-
config_param :
|
19
|
-
|
20
|
-
config_param :
|
21
|
-
|
22
|
-
config_param :
|
23
|
-
|
24
|
-
config_param :
|
25
|
-
|
26
|
-
config_param :
|
21
|
+
config_param :count_interval, :time, :default => nil,
|
22
|
+
:desc => 'The interval time to count in seconds.'
|
23
|
+
config_param :unit, :string, :default => 'minute',
|
24
|
+
:desc => 'The interval time to monitor specified an unit (either of minute, hour, or day).'
|
25
|
+
config_param :output_per_tag, :bool, :default => false,
|
26
|
+
:desc => 'Emit for each input tag. tag_prefix must be specified together.'
|
27
|
+
config_param :aggregate, :string, :default => 'tag',
|
28
|
+
:desc => 'Calculate in each input tag separetely, or all records in a mass.'
|
29
|
+
config_param :tag, :string, :default => 'datacount',
|
30
|
+
:desc => 'The output tag.'
|
31
|
+
config_param :tag_prefix, :string, :default => nil,
|
32
|
+
:desc => 'The prefix string which will be added to the input tag.'
|
33
|
+
config_param :input_tag_remove_prefix, :string, :default => nil,
|
34
|
+
:desc => 'The prefix string which will be removed from the input tag.'
|
35
|
+
config_param :count_key, :string,
|
36
|
+
:desc => 'The key to count in the event record.'
|
37
|
+
config_param :outcast_unmatched, :bool, :default => false,
|
38
|
+
:desc => 'Specify yes if you do not want to include \'unmatched\' counts into percentage. '
|
39
|
+
config_param :output_messages, :bool, :default => false,
|
40
|
+
:desc => 'Specify yes if you want to get tested messages.'
|
41
|
+
config_param :store_file, :string, :default => nil,
|
42
|
+
:desc => 'Store internal data into a file of the given path on shutdown, and load on starting.'
|
27
43
|
|
28
44
|
# pattern0 reserved as unmatched counts
|
29
|
-
config_param :pattern1, :string # string: NAME REGEXP
|
45
|
+
config_param :pattern1, :string, # string: NAME REGEXP
|
46
|
+
:desc => 'Specify RegexpName and Regexp. format: NAME REGEXP'
|
30
47
|
(2..PATTERN_MAX_NUM).each do |i|
|
31
|
-
config_param ('pattern' + i.to_s).to_sym, :string, :default => nil # NAME REGEXP
|
48
|
+
config_param ('pattern' + i.to_s).to_sym, :string, :default => nil, # NAME REGEXP
|
49
|
+
:desc => "Specify RegexpName and Regexp. format: NAME REGEXP"
|
32
50
|
end
|
33
51
|
|
34
52
|
attr_accessor :tick
|
@@ -221,12 +239,12 @@ class Fluent::DataCounterOutput < Fluent::Output
|
|
221
239
|
# tag - message maps
|
222
240
|
time = Fluent::Engine.now
|
223
241
|
flush_per_tags(step).each do |tag,message|
|
224
|
-
|
242
|
+
router.emit(@tag_prefix_string + tag, time, message)
|
225
243
|
end
|
226
244
|
else
|
227
245
|
message = flush(step)
|
228
246
|
if message.keys.size > 0
|
229
|
-
|
247
|
+
router.emit(@tag, Fluent::Engine.now, message)
|
230
248
|
end
|
231
249
|
end
|
232
250
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluent-plugin-datacounter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- TAGOMORI Satoshi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-12-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fluentd
|
@@ -101,7 +101,7 @@ files:
|
|
101
101
|
- test/plugin/test_out_datacounter.rb
|
102
102
|
homepage: https://github.com/tagomoris/fluent-plugin-datacounter
|
103
103
|
licenses:
|
104
|
-
-
|
104
|
+
- Apache-2.0
|
105
105
|
metadata: {}
|
106
106
|
post_install_message:
|
107
107
|
rdoc_options: []
|