fluent-plugin-grepcounter 0.5.6 → 0.6.0

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: f187009dead1522e4bef22b7a505085d271ee46c
4
- data.tar.gz: ff997a2771fa6e16a5fa6f44758d0a46d59cbeeb
3
+ metadata.gz: ea3e539761fa0ef96bbda6bd542b61f0895cea0a
4
+ data.tar.gz: 216334103aeb12132996863c36044758da74e822
5
5
  SHA512:
6
- metadata.gz: 2fa074c1989f4117b55a5e656d7e1290e8e60dfe9ce55c97c007da627bea24bf4690256413c6bac5d688a9c585b1d9b3f65a421b568a6ccd1b8784460cf9d944
7
- data.tar.gz: 12d5df257832eb73754849bc9b0acc95a0834cc05b4ab32ed0f996ad6732525daf2971dbbb4074734c987b8e3b9340ff0691dba9d0cb34c6a69316b432954296
6
+ metadata.gz: 9c916df6a00e90ee8d5f0be5d8a1f7e1067d147f25005d8e5678ac62ea6331c8abab30a8f14046c9eec1acfa753cbac1d2dfc5484636f8e495b4fd2f1803518e
7
+ data.tar.gz: bec68bc60449c25b7f4ffefeddc227e170e929871b5dfd3fe46381a478a5ec5ebcb7310d9033184825d9f046cba0ac797f4f9104f60fd0840aadafe2aaae2909
@@ -1,6 +1,9 @@
1
+ sudo: false
1
2
  rvm:
2
- - 1.9.3
3
- - 2.0.0
4
3
  - 2.1.*
4
+ - 2.2.*
5
+ - 2.3.0
5
6
  gemfile:
6
7
  - Gemfile
8
+ before_install:
9
+ - gem update bundler
@@ -1,3 +1,14 @@
1
+ ## 0.6.0 (2017/01/23)
2
+
3
+ Changes:
4
+
5
+ * Drop ruby 1.9.2 and 2.0.0 supports
6
+
7
+ Enhancements:
8
+
9
+ * Add config descriptions
10
+ * Add fluent module require explicitly
11
+
1
12
  ## 0.5.6 (2015/05/10)
2
13
 
3
14
  Enhancements:
@@ -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.5.6"
6
+ s.version = "0.6.0"
7
7
  s.authors = ["Naotoshi Seo"]
8
8
  s.email = ["sonots@gmail.com"]
9
9
  s.homepage = "https://github.com/sonots/fluent-plugin-grepcounter"
@@ -25,4 +25,5 @@ Gem::Specification.new do |s|
25
25
  s.add_development_dependency "pry"
26
26
  s.add_development_dependency "pry-nav"
27
27
  s.add_development_dependency "coveralls"
28
+ s.add_development_dependency "test-unit", "~> 3.1.5"
28
29
  end
@@ -1,3 +1,5 @@
1
+ require 'fluent/output'
2
+
1
3
  # encoding: UTF-8
2
4
  class Fluent::GrepCounterOutput < Fluent::Output
3
5
  Fluent::Plugin.register_output('grepcounter', self)
@@ -19,30 +21,64 @@ class Fluent::GrepCounterOutput < Fluent::Output
19
21
  require 'pathname'
20
22
  end
21
23
 
22
- config_param :input_key, :string, :default => nil
23
- config_param :regexp, :string, :default => nil
24
- config_param :exclude, :string, :default => nil
25
- (1..REGEXP_MAX_NUM).each {|i| config_param :"regexp#{i}", :string, :default => nil }
24
+ config_param :input_key, :string, :default => nil,
25
+ :desc => <<-DESC
26
+ The target field key to grep out.
27
+ Use with regexp or exclude.
28
+ DESC
29
+ config_param :regexp, :string, :default => nil,
30
+ :desc => 'The filtering regular expression.'
31
+ config_param :exclude, :string, :default => nil,
32
+ :desc => 'The excluding regular expression like grep -v.'
33
+ (1..REGEXP_MAX_NUM).each {|i| config_param :"regexp#{i}", :string, :default => nil }
26
34
  (1..REGEXP_MAX_NUM).each {|i| config_param :"exclude#{i}", :string, :default => nil }
27
- config_param :count_interval, :time, :default => 5
28
- config_param :threshold, :integer, :default => nil # not obsolete, though
35
+ config_param :count_interval, :time, :default => 5,
36
+ :desc => 'The interval time to count in seconds.'
37
+ config_param :threshold, :integer, :default => nil, # not obsolete, though
38
+ :desc => <<-DESC
39
+ The threshold number to emit.
40
+ Emit if count value >= specified value.
41
+ Note that this param is not obsolete.
42
+ DESC
29
43
  config_param :comparator, :string, :default => '>=' # obsolete
30
- config_param :less_than, :float, :default => nil
31
- config_param :less_equal, :float, :default => nil
32
- config_param :greater_than, :float, :default => nil
33
- config_param :greater_equal, :float, :default => nil
44
+ config_param :less_than, :float, :default => nil,
45
+ :desc => 'Emit if count value is less than (<) specified value.'
46
+ config_param :less_equal, :float, :default => nil,
47
+ :desc => 'Emit if count value is less than or equal to (<=) specified value.'
48
+ config_param :greater_than, :float, :default => nil,
49
+ :desc => 'Emit if count value is greater than (>) specified value.'
50
+ config_param :greater_equal, :float, :default => nil,
51
+ :desc => <<-DESC
52
+ This is same with threshold option.
53
+ Emit if count value is greater than or equal to (>=) specified value.
54
+ DESC
34
55
  config_param :output_tag, :string, :default => nil # obsolete
35
- config_param :tag, :string, :default => nil
36
- config_param :add_tag_prefix, :string, :default => nil
37
- config_param :remove_tag_prefix, :string, :default => nil
38
- config_param :add_tag_suffix, :string, :default => nil
39
- config_param :remove_tag_suffix, :string, :default => nil
40
- config_param :remove_tag_slice, :string, :default => nil
56
+ config_param :tag, :string, :default => nil,
57
+ :desc => 'The output tag. Required for aggregate all.'
58
+ config_param :add_tag_prefix, :string, :default => nil,
59
+ :desc => 'Add tag prefix for output message.'
60
+ config_param :remove_tag_prefix, :string, :default => nil,
61
+ :desc => 'Remove tag prefix for output message.'
62
+ config_param :add_tag_suffix, :string, :default => nil,
63
+ :desc => 'Add tag suffix for output message.'
64
+ config_param :remove_tag_suffix, :string, :default => nil,
65
+ :desc => 'Remove tag suffix for output message.'
66
+ config_param :remove_tag_slice, :string, :default => nil,
67
+ :desc => <<-DESC
68
+ Remove tag parts by slice function.
69
+ Note that this option behaves like tag.split('.').slice(min..max).
70
+ DESC
41
71
  config_param :output_with_joined_delimiter, :string, :default => nil # obsolete
42
- config_param :delimiter, :string, :default => nil
43
- config_param :aggregate, :string, :default => 'tag'
44
- config_param :replace_invalid_sequence, :bool, :default => false
45
- config_param :store_file, :string, :default => nil
72
+ config_param :delimiter, :string, :default => nil,
73
+ :desc => 'Output matched messages after joined with the specified delimiter.'
74
+ config_param :aggregate, :string, :default => 'tag',
75
+ :desc => 'Aggregation unit. One of all, in_tag, out_tag can be specified.'
76
+ config_param :replace_invalid_sequence, :bool, :default => false,
77
+ :desc => "Replace invalid byte sequence in UTF-8 with '?' character if true."
78
+ config_param :store_file, :string, :default => nil,
79
+ :desc => <<-DESC
80
+ Store internal count data into a file of the given path on shutdown, and load on statring.
81
+ DESC
46
82
 
47
83
  attr_accessor :counts
48
84
  attr_accessor :matches
@@ -526,10 +526,10 @@ describe Fluent::GrepCounterOutput do
526
526
  loaded_saved_at = driver.instance.saved_at
527
527
  loaded_saved_duration = driver.instance.saved_duration
528
528
 
529
- expect(loaded_counts).to eql(stored_counts)
530
- expect(loaded_matches).to eql(stored_matches)
531
- expect(loaded_saved_at).to eql(stored_saved_at)
532
- expect(loaded_saved_duration).to eql(stored_saved_duration)
529
+ expect(loaded_counts).to eq(stored_counts)
530
+ expect(loaded_matches).to eq(stored_matches)
531
+ expect(loaded_saved_at).to eq(stored_saved_at)
532
+ expect(loaded_saved_duration).to eq(stored_saved_duration)
533
533
  end
534
534
  end
535
535
 
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.5.6
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Naotoshi Seo
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-09 00:00:00.000000000 Z
11
+ date: 2017-01-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fluentd
@@ -108,6 +108,20 @@ dependencies:
108
108
  - - ">="
109
109
  - !ruby/object:Gem::Version
110
110
  version: '0'
111
+ - !ruby/object:Gem::Dependency
112
+ name: test-unit
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - "~>"
116
+ - !ruby/object:Gem::Version
117
+ version: 3.1.5
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - "~>"
123
+ - !ruby/object:Gem::Version
124
+ version: 3.1.5
111
125
  description: Fluentd plugin to count the number of matched messages, and emit if exceeds
112
126
  the threshold
113
127
  email:
@@ -149,7 +163,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
149
163
  version: '0'
150
164
  requirements: []
151
165
  rubyforge_project: fluent-plugin-grepcounter
152
- rubygems_version: 2.2.2
166
+ rubygems_version: 2.5.2
153
167
  signing_key:
154
168
  specification_version: 4
155
169
  summary: Fluentd plugin to count the number of matched messages, and emit if exceeds