fluent-plugin-datacounter 0.4.4 → 0.4.5

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 64d80ad86bd2585306cd7f6e9ba750f7949d1740
4
- data.tar.gz: dc801aa3ae66d93fd1e476743629a06d9dd9df75
3
+ metadata.gz: 4cfe9eca2a4e10f492885b664bacc09ad0b7778b
4
+ data.tar.gz: 3830e5d5e8d337cb69c68b1498616c9db434693c
5
5
  SHA512:
6
- metadata.gz: 99dea601abca6ae123a04e568e5ead302af893f86c4ab9b0682a9f4a6993896aee5cd3f524a03dfcde536905e25a2ed0d1d5e70577161c2e5032b1fc3c46f02b
7
- data.tar.gz: 7cc35142eb8ec3484188f4a95656d22ba8983ed994a6d69ce46050925eded3cb22e7f2a16f9bcfe778492d7721791f6546d03cd3514ac228873e5ead521aced7
6
+ metadata.gz: 0db6a72abf014b2cc6ba7a4910774cd757e68552068500b31b0d02245371ecda00c2cbd1d2573bc1acef60ebc75462a9dab190f73ef9017ca1ce77d2de09c560
7
+ data.tar.gz: bfb3bad278d68359493f2cf1a431e0870691d92fa11aab3317f6004ad9feccfc3abee5dc77382c48d6395d987db14b933c7f3629659b382c516fee3f891366e1
@@ -1,4 +1,6 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 1.9.3
4
3
  - 2.0.0
4
+ - 2.1.8
5
+ - 2.2.4
6
+
@@ -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"
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 = "APLv2"
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
- config_param :unit, :string, :default => 'minute'
18
- config_param :output_per_tag, :bool, :default => false
19
- config_param :aggregate, :string, :default => 'tag'
20
- config_param :tag, :string, :default => 'datacount'
21
- config_param :tag_prefix, :string, :default => nil
22
- config_param :input_tag_remove_prefix, :string, :default => nil
23
- config_param :count_key, :string
24
- config_param :outcast_unmatched, :bool, :default => false
25
- config_param :output_messages, :bool, :default => false
26
- config_param :store_file, :string, :default => nil
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
- Fluent::Engine.emit(@tag_prefix_string + tag, time, message)
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
- Fluent::Engine.emit(@tag, Fluent::Engine.now, message)
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
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-03-26 00:00:00.000000000 Z
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
- - APLv2
104
+ - Apache-2.0
105
105
  metadata: {}
106
106
  post_install_message:
107
107
  rdoc_options: []