fluent-plugin-extract_query_params 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 0c086b1205a77f356fe739ca372e9d9096ecb240
|
4
|
+
data.tar.gz: ac836af781045c1ba139d78addd7529b3d187452
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 93d84479e94172cb3eaa65494e32c778399c3e519f3e1068a0f62cec064b3d415d640406468097e0bc783cef3ef37408e88bc7c340d7f8b0abf28d3685fe7c5c
|
7
|
+
data.tar.gz: e5ef9c2db143564c740c23b13dabab2bc2993d64d19059972c27f4ca14fa059abcbc3a8ec22d68fd467ed0ea4280dd3b05e8a44a497800e9286c497465bb9214
|
data/README.md
CHANGED
@@ -60,6 +60,10 @@ If set, only the key/value whose key is included `only` will be added to the rec
|
|
60
60
|
|
61
61
|
If set, the key/value whose key is included `except` will NOT be added to the record.
|
62
62
|
|
63
|
+
### discard_key
|
64
|
+
|
65
|
+
If set to `true`, the original `key` url will be discarded from the record. Defaults to `false` (preserve key).
|
66
|
+
|
63
67
|
## Installation
|
64
68
|
|
65
69
|
Add this line to your application's Gemfile:
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |gem|
|
2
2
|
gem.name = 'fluent-plugin-extract_query_params'
|
3
|
-
gem.version = '0.0.
|
3
|
+
gem.version = '0.0.3'
|
4
4
|
gem.authors = ['Kentaro Kuribayashi']
|
5
5
|
gem.email = ['kentarok@gmail.com']
|
6
6
|
gem.homepage = 'http://github.com/kentaro/fluent-plugin-extract_query_params'
|
@@ -9,6 +9,7 @@ module Fluent
|
|
9
9
|
config_param :key, :string
|
10
10
|
config_param :only, :string, :default => nil
|
11
11
|
config_param :except, :string, :default => nil
|
12
|
+
config_param :discard_key, :bool, :default => false
|
12
13
|
|
13
14
|
def configure(conf)
|
14
15
|
super
|
@@ -59,6 +60,7 @@ module Fluent
|
|
59
60
|
end
|
60
61
|
end
|
61
62
|
end
|
63
|
+
record.delete key if discard_key
|
62
64
|
rescue URI::InvalidURIError => error
|
63
65
|
$log.warn("out_extract_query_params: #{error.message}")
|
64
66
|
end
|
@@ -86,6 +86,24 @@ class ExtractQueryParamsOutputTest < Test::Unit::TestCase
|
|
86
86
|
assert_nil record['モリス']
|
87
87
|
end
|
88
88
|
|
89
|
+
def test_filter_record_with_discard
|
90
|
+
d = create_driver(%[
|
91
|
+
key url
|
92
|
+
add_tag_prefix extracted.
|
93
|
+
discard_key true
|
94
|
+
])
|
95
|
+
|
96
|
+
tag = 'test'
|
97
|
+
record = { 'url' => URL }
|
98
|
+
d.instance.filter_record('test', Time.now, record)
|
99
|
+
|
100
|
+
assert_nil record['nil']
|
101
|
+
assert_nil record['url']
|
102
|
+
assert_equal 'bar', record['foo']
|
103
|
+
assert_equal 'qux', record['baz']
|
104
|
+
assert_equal 'すたじお', record['モリス']
|
105
|
+
end
|
106
|
+
|
89
107
|
def test_emit
|
90
108
|
d = create_driver(%[
|
91
109
|
key url
|
metadata
CHANGED
@@ -1,62 +1,55 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluent-plugin-extract_query_params
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
5
|
-
prerelease:
|
4
|
+
version: 0.0.3
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Kentaro Kuribayashi
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date: 2013-
|
11
|
+
date: 2013-05-20 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: rake
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
|
-
- -
|
17
|
+
- - '>='
|
20
18
|
- !ruby/object:Gem::Version
|
21
19
|
version: '0'
|
22
20
|
type: :development
|
23
21
|
prerelease: false
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
23
|
requirements:
|
27
|
-
- -
|
24
|
+
- - '>='
|
28
25
|
- !ruby/object:Gem::Version
|
29
26
|
version: '0'
|
30
27
|
- !ruby/object:Gem::Dependency
|
31
28
|
name: fluentd
|
32
29
|
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
30
|
requirements:
|
35
|
-
- -
|
31
|
+
- - '>='
|
36
32
|
- !ruby/object:Gem::Version
|
37
33
|
version: '0'
|
38
34
|
type: :development
|
39
35
|
prerelease: false
|
40
36
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
37
|
requirements:
|
43
|
-
- -
|
38
|
+
- - '>='
|
44
39
|
- !ruby/object:Gem::Version
|
45
40
|
version: '0'
|
46
41
|
- !ruby/object:Gem::Dependency
|
47
42
|
name: fluentd
|
48
43
|
requirement: !ruby/object:Gem::Requirement
|
49
|
-
none: false
|
50
44
|
requirements:
|
51
|
-
- -
|
45
|
+
- - '>='
|
52
46
|
- !ruby/object:Gem::Version
|
53
47
|
version: '0'
|
54
48
|
type: :runtime
|
55
49
|
prerelease: false
|
56
50
|
version_requirements: !ruby/object:Gem::Requirement
|
57
|
-
none: false
|
58
51
|
requirements:
|
59
|
-
- -
|
52
|
+
- - '>='
|
60
53
|
- !ruby/object:Gem::Version
|
61
54
|
version: '0'
|
62
55
|
description: Fluentd plugin to extract key/values from URL query parameters.
|
@@ -77,27 +70,26 @@ files:
|
|
77
70
|
- test/test_helper.rb
|
78
71
|
homepage: http://github.com/kentaro/fluent-plugin-extract_query_params
|
79
72
|
licenses: []
|
73
|
+
metadata: {}
|
80
74
|
post_install_message:
|
81
75
|
rdoc_options: []
|
82
76
|
require_paths:
|
83
77
|
- lib
|
84
78
|
required_ruby_version: !ruby/object:Gem::Requirement
|
85
|
-
none: false
|
86
79
|
requirements:
|
87
|
-
- -
|
80
|
+
- - '>='
|
88
81
|
- !ruby/object:Gem::Version
|
89
82
|
version: '0'
|
90
83
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
91
|
-
none: false
|
92
84
|
requirements:
|
93
|
-
- -
|
85
|
+
- - '>='
|
94
86
|
- !ruby/object:Gem::Version
|
95
87
|
version: '0'
|
96
88
|
requirements: []
|
97
89
|
rubyforge_project:
|
98
|
-
rubygems_version:
|
90
|
+
rubygems_version: 2.0.0
|
99
91
|
signing_key:
|
100
|
-
specification_version:
|
92
|
+
specification_version: 4
|
101
93
|
summary: Fluentd plugin to extract key/values from URL query parameters
|
102
94
|
test_files:
|
103
95
|
- test/plugin/test_out_extract_query_params.rb
|