fluent-plugin-extract_query_params 0.0.3 → 0.0.4
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 172e07237ab226e9898f9027becf4e2a11bc0ec6
|
4
|
+
data.tar.gz: 7b262ace7e04bb2b01475bccbeffe4da4fbfcebe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: adfcafa57eccff147dfff505af4966223e32e1c2debc9705c1f5c556c507280247ba9b83261cc15268f08f894fb67ca444a77dc356afd18da5225236f331d937
|
7
|
+
data.tar.gz: 9bf7c62140559f4d6a233e0e785bf64835863ff132a7dc00dd69e8af7272d68f1cdde621b7f741a856602fd8ab8a3ecad4ba3ced35d0ded3bc11eed56c5bbaf5
|
@@ -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.4'
|
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'
|
@@ -10,6 +10,7 @@ module Fluent
|
|
10
10
|
config_param :only, :string, :default => nil
|
11
11
|
config_param :except, :string, :default => nil
|
12
12
|
config_param :discard_key, :bool, :default => false
|
13
|
+
config_param :add_field_prefix, :string, :default => nil
|
13
14
|
|
14
15
|
def configure(conf)
|
15
16
|
super
|
@@ -51,6 +52,7 @@ module Fluent
|
|
51
52
|
url.query.split('&').each do |pair|
|
52
53
|
key, value = pair.split('=').map { |i| URI.unescape(i) }
|
53
54
|
|
55
|
+
key = @add_field_prefix + key if @add_field_prefix
|
54
56
|
if only
|
55
57
|
record[key] = value if @include_keys.has_key?(key)
|
56
58
|
elsif except
|
@@ -52,6 +52,28 @@ class ExtractQueryParamsOutputTest < Test::Unit::TestCase
|
|
52
52
|
assert_equal 'すたじお', record['モリス']
|
53
53
|
end
|
54
54
|
|
55
|
+
def test_filter_record_with_field_prefix
|
56
|
+
d = create_driver(%[
|
57
|
+
key url
|
58
|
+
add_field_prefix query_
|
59
|
+
add_tag_prefix extracted.
|
60
|
+
])
|
61
|
+
|
62
|
+
tag = 'test'
|
63
|
+
record = {
|
64
|
+
'url' => URL,
|
65
|
+
}
|
66
|
+
d.instance.filter_record('test', Time.now, record)
|
67
|
+
|
68
|
+
assert_equal URL, record['url']
|
69
|
+
assert_nil record['foo']
|
70
|
+
assert_nil record['baz']
|
71
|
+
assert_nil record['モリス']
|
72
|
+
assert_equal 'bar', record['query_foo']
|
73
|
+
assert_equal 'qux', record['query_baz']
|
74
|
+
assert_equal 'すたじお', record['query_モリス']
|
75
|
+
end
|
76
|
+
|
55
77
|
def test_filter_record_with_only
|
56
78
|
d = create_driver(%[
|
57
79
|
key url
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
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.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kentaro Kuribayashi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-05-
|
11
|
+
date: 2013-05-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|