fluent-plugin-filter 0.0.0 → 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/README.rdoc CHANGED
@@ -35,11 +35,13 @@ Filter out messages contains <tt>{status : 404}</tt> :
35
35
  type stdout
36
36
  </match>
37
37
 
38
- in above configuration, {status: 404} is filtered out and {status: 200}, {status: 303}, {status: 401} passed.
38
+ in above configuration, <tt>{status: 404}</tt> is filtered out and <tt>{status: 200}</tt>, <tt>{status: 303}</tt>, <tt>{status: 401}</tt> passed.
39
39
  Messages passing filter are add_prefix (default filtered.)
40
40
 
41
41
  So you catch "filtered" tag and do next process.
42
42
 
43
+ You can use int, float, string, regexp in value.
44
+
43
45
  == Contributing
44
46
 
45
47
  1. Fork it
@@ -1,6 +1,6 @@
1
1
  # -*- encoding: utf-8 -*-
2
2
  Gem::Specification.new do |gem|
3
- gem.authors = ["muddydixon"]
3
+ gem.authors = ["Muddy Dixon"]
4
4
  gem.email = ["muddydixon@gmail.com"]
5
5
  gem.description = %q{Simple output filter}
6
6
  gem.summary = %q{Simple output filter}
@@ -12,7 +12,7 @@ Gem::Specification.new do |gem|
12
12
  gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
13
13
  gem.name = "fluent-plugin-filter"
14
14
  gem.require_paths = ["lib"]
15
- gem.version = "0.0.0"
15
+ gem.version = "0.0.1"
16
16
 
17
17
  gem.extra_rdoc_files = [
18
18
  "ChangeLog",
@@ -18,7 +18,7 @@ class FilterOutput < Output
18
18
 
19
19
  def toMap (str)
20
20
  str.split(/\s*,\s*/).map do|pair|
21
- k, v = pair.split(/\s*:\s*/)
21
+ k, v = pair.split(/\s*:\s*/, 2)
22
22
  if v =~ /^\d+$/
23
23
  v = v.to_i
24
24
  elsif v =~ /^[\d\.]+(e\d+)?$/
@@ -50,6 +50,14 @@ class Filter < Test::Unit::TestCase
50
50
  assert_equal [['status', '200']], d.instance.allows
51
51
  assert_equal [], d.instance.denies
52
52
 
53
+ # text value
54
+ d = create_driver %[
55
+ all deny
56
+ allow status: "https://my.website.com/"
57
+ ]
58
+ assert_equal [['status', 'https://my.website.com/']], d.instance.allows
59
+ assert_equal [], d.instance.denies
60
+
53
61
  # regexp value
54
62
  d = create_driver %[
55
63
  all deny
metadata CHANGED
@@ -1,19 +1,19 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-filter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.0
4
+ version: 0.0.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
8
- - muddydixon
8
+ - Muddy Dixon
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-08-30 00:00:00.000000000 Z
12
+ date: 2013-07-17 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: fluentd
16
- requirement: &2152828080 !ruby/object:Gem::Requirement
16
+ requirement: &2160456580 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: *2152828080
24
+ version_requirements: *2160456580
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: fluentd
27
- requirement: &2152827620 !ruby/object:Gem::Requirement
27
+ requirement: &2160456040 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,7 +32,7 @@ dependencies:
32
32
  version: '0'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *2152827620
35
+ version_requirements: *2160456040
36
36
  description: Simple output filter
37
37
  email:
38
38
  - muddydixon@gmail.com