fluent-plugin-grep 0.2.0 → 0.2.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 96e41f9ac8b3207023da172df7e94f0890dda86d
4
- data.tar.gz: 5e0d3601c87d4a5cba48dd0395947287e36285e9
3
+ metadata.gz: 2e382e08c49b5adc65ff681356c292423a90eff1
4
+ data.tar.gz: 6eeb7e28f4e75a25a15ff816299062625fa5939d
5
5
  SHA512:
6
- metadata.gz: ec7018222ac042c04f005e9e3d294c2e32d810cd6296ddf7139b67685008546cdfcd7599e83c11a41c5cc9774f7eb7f1871a49725eccb847a5017038952a7685
7
- data.tar.gz: 52f35e4778260dfffaf3ccc6b4d8ca09d37b5597e3a140a93c9201a175ed6b634f17ee6510bbaf4ee6951064c020ecbc81d0673c4934779601e9ddfe252b6e90
6
+ metadata.gz: eb7f1ab442ae55877b383bfacb4e8b44d723052574fdd4d870f3c32b10ca19b209a8749eeb641779cbbc9f6851167586f97b9c0f487fdf2f9d63303ea7b1c912
7
+ data.tar.gz: 959c770dbfc9dc31326f311c1ade4d9c85b6831a3a192dcece72d17aa7ba951e53a9dbc8eec7f91a80a4ececa3c216be7bb7b2f18cc03e6dcfabe77c4d8c26d3
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## 0.2.1 (2013/12/12)
2
+
3
+ Features:
4
+
5
+ - Allow to use `remove_tag_prefix` option alone
6
+
1
7
  ## 0.2.0 (2013/11/30)
2
8
 
3
9
  Features:
@@ -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-grep"
6
- s.version = "0.2.0"
6
+ s.version = "0.2.1"
7
7
  s.authors = ["Naotoshi Seo"]
8
8
  s.email = ["sonots@gmail.com"]
9
9
  s.homepage = "https://github.com/sonots/fluent-plugin-grep"
@@ -5,7 +5,7 @@ class Fluent::GrepOutput < Fluent::Output
5
5
  config_param :regexp, :string, :default => nil
6
6
  config_param :exclude, :string, :default => nil
7
7
  config_param :tag, :string, :default => nil
8
- config_param :add_tag_prefix, :string, :default => 'greped'
8
+ config_param :add_tag_prefix, :string, :default => nil
9
9
  config_param :remove_tag_prefix, :string, :default => nil
10
10
  config_param :replace_invalid_sequence, :bool, :default => false
11
11
 
@@ -15,9 +15,13 @@ class Fluent::GrepOutput < Fluent::Output
15
15
  @input_key = @input_key.to_s
16
16
  @regexp = Regexp.compile(@regexp) if @regexp
17
17
  @exclude = Regexp.compile(@exclude) if @exclude
18
- @tag_prefix = "#{@add_tag_prefix}."
19
- @tag_prefix_match = "#{@remove_tag_prefix}." if @remove_tag_prefix
20
18
 
19
+ if @tag.nil? and @add_tag_prefix.nil? and @remove_tag_prefix.nil?
20
+ @add_tag_prefix = 'greped' # not ConfigError to support lower version compatibility
21
+ end
22
+
23
+ @tag_prefix = "#{@add_tag_prefix}." if @add_tag_prefix
24
+ @tag_prefix_match = "#{@remove_tag_prefix}." if @remove_tag_prefix
21
25
  @tag_proc =
22
26
  if @tag
23
27
  Proc.new {|tag| @tag }
@@ -119,13 +119,12 @@ describe Fluent::GrepOutput do
119
119
  let(:config) do
120
120
  CONFIG + %[
121
121
  regexp ping
122
- add_tag_prefix foo
123
122
  remove_tag_prefix syslog
124
123
  ]
125
124
  end
126
125
  before do
127
126
  Fluent::Engine.stub(:now).and_return(time)
128
- Fluent::Engine.should_receive(:emit).with("foo.host1", time, {'foo'=>'bar', 'message'=>"2013/01/13T07:02:11.124202 INFO GET /ping"})
127
+ Fluent::Engine.should_receive(:emit).with("host1", time, {'foo'=>'bar', 'message'=>"2013/01/13T07:02:11.124202 INFO GET /ping"})
129
128
  end
130
129
  it { emit }
131
130
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-grep
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Naotoshi Seo
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-11-29 00:00:00.000000000 Z
11
+ date: 2013-12-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fluentd