fluent-plugin-woothee 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -1
- data/fluent-plugin-woothee.gemspec +6 -5
- data/lib/fluent/plugin/out_woothee.rb +2 -5
- data/test/plugin/test_out_woothee.rb +13 -1
- metadata +24 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a023e5af86e6a0c8e61e478271210b67f49a0cb9
|
4
|
+
data.tar.gz: 47c03e7e2554c15a2839b4e78f207cce867ebdd2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4d4ec145c669b50764a57b546e2697d25237789c0e5e9339f6e35c9908db5bfcfd99cfe55225e9b305e80464e5becdbb1fabbffff21d5ae8c936ef66f75f3503
|
7
|
+
data.tar.gz: 629c34ed3cc1c175df26a3f06409fd1c0c3923163f0f7673b72a1fb967dc14db38f16ee3fb675b85320bcfb2d49f319742e5bd02457b50444d92348d21bcfa3b
|
data/README.md
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
|
5
5
|
'fluent-plugin-woothee' is a Fluentd plugin to parse UserAgent strings and to filter/drop specified categories of user terminals (like 'pc', 'smartphone' and so on).
|
6
6
|
|
7
|
-
'woothee' is multi-language user-agent strings parser project. See: https://github.com/
|
7
|
+
'woothee' is multi-language user-agent strings parser project. See: https://github.com/woothee/woothee
|
8
8
|
|
9
9
|
## Configuration
|
10
10
|
|
@@ -29,6 +29,7 @@ Output messages with tag 'merged.**' has attributes like 'agent\_name', 'agent\_
|
|
29
29
|
out_key_name ua_name
|
30
30
|
out_key_category ua_category
|
31
31
|
out_key_os ua_os
|
32
|
+
out_key_os_version ua_os_version
|
32
33
|
out_key_version ua_version
|
33
34
|
out_key_vendor ua_vendor
|
34
35
|
</match>
|
@@ -2,12 +2,12 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |gem|
|
4
4
|
gem.name = "fluent-plugin-woothee"
|
5
|
-
gem.version = "0.1.
|
5
|
+
gem.version = "0.1.1"
|
6
6
|
gem.authors = ["TAGOMORI Satoshi"]
|
7
7
|
gem.email = ["tagomoris@gmail.com"]
|
8
|
-
gem.description = %q{parsing by Project Woothee. See https://github.com/
|
9
|
-
gem.summary = %q{Fluentd plugin to parse UserAgent strings}
|
10
|
-
gem.homepage = "https://github.com/
|
8
|
+
gem.description = %q{parsing by Project Woothee. See https://github.com/woothee/woothee }
|
9
|
+
gem.summary = %q{Fluentd plugin to parse UserAgent strings with woothee parser. It adds device information or filter records with specific device types.}
|
10
|
+
gem.homepage = "https://github.com/tagomoris/fluent-plugin-woothee"
|
11
11
|
gem.license = "APLv2"
|
12
12
|
|
13
13
|
gem.files = `git ls-files`.split($\)
|
@@ -16,6 +16,7 @@ Gem::Specification.new do |gem|
|
|
16
16
|
gem.require_paths = ["lib"]
|
17
17
|
|
18
18
|
gem.add_development_dependency "rake"
|
19
|
+
gem.add_development_dependency "test-unit", "~> 3.0.2"
|
19
20
|
gem.add_runtime_dependency "fluentd"
|
20
|
-
gem.add_runtime_dependency "woothee", ">= 0.
|
21
|
+
gem.add_runtime_dependency "woothee", ">= 1.0.0"
|
21
22
|
end
|
@@ -22,6 +22,7 @@ class Fluent::WootheeOutput < Fluent::Output
|
|
22
22
|
config_param :out_key_name, :string, :default => 'agent_name'
|
23
23
|
config_param :out_key_category, :string, :default => 'agent_category'
|
24
24
|
config_param :out_key_os, :string, :default => 'agent_os'
|
25
|
+
config_param :out_key_os_version, :string, :default => nil # supress output
|
25
26
|
config_param :out_key_version, :string, :default => nil # supress output
|
26
27
|
config_param :out_key_vendor, :string, :default => nil # supress output
|
27
28
|
|
@@ -30,11 +31,6 @@ class Fluent::WootheeOutput < Fluent::Output
|
|
30
31
|
require 'woothee'
|
31
32
|
end
|
32
33
|
|
33
|
-
# Define `log` method for v0.10.42 or earlier
|
34
|
-
unless method_defined?(:log)
|
35
|
-
define_method("log") { $log }
|
36
|
-
end
|
37
|
-
|
38
34
|
def configure(conf)
|
39
35
|
super
|
40
36
|
|
@@ -126,6 +122,7 @@ class Fluent::WootheeOutput < Fluent::Output
|
|
126
122
|
@out_key_category => parsed[Woothee::ATTRIBUTE_CATEGORY].to_s,
|
127
123
|
@out_key_os => parsed[Woothee::ATTRIBUTE_OS]
|
128
124
|
})
|
125
|
+
record[@out_key_os_version] = parsed[Woothee::ATTRIBUTE_OS_VERSION] if @out_key_os_version
|
129
126
|
record[@out_key_version] = parsed[Woothee::ATTRIBUTE_VERSION] if @out_key_version
|
130
127
|
record[@out_key_vendor] = parsed[Woothee::ATTRIBUTE_VENDOR] if @out_key_vendor
|
131
128
|
end
|
@@ -28,6 +28,7 @@ merge_agent_info yes
|
|
28
28
|
out_key_name ua_name
|
29
29
|
out_key_category ua_category
|
30
30
|
out_key_os ua_os
|
31
|
+
out_key_os_version ua_os_version
|
31
32
|
out_key_version ua_version
|
32
33
|
out_key_vendor ua_vendor
|
33
34
|
]
|
@@ -40,6 +41,10 @@ drop_categories crawler,misc
|
|
40
41
|
tag selected
|
41
42
|
]
|
42
43
|
|
44
|
+
def setup
|
45
|
+
Fluent::Test.setup
|
46
|
+
end
|
47
|
+
|
43
48
|
def create_driver(conf=CONFIG1,tag='test')
|
44
49
|
Fluent::Test::OutputTestDriver.new(Fluent::WootheeOutput, tag).configure(conf)
|
45
50
|
end
|
@@ -85,6 +90,7 @@ tag selected
|
|
85
90
|
assert_equal 'ua_name', d.instance.out_key_name
|
86
91
|
assert_equal 'ua_category', d.instance.out_key_category
|
87
92
|
assert_equal 'ua_os', d.instance.out_key_os
|
93
|
+
assert_equal 'ua_os_version', d.instance.out_key_os_version
|
88
94
|
assert_equal 'ua_version', d.instance.out_key_version
|
89
95
|
assert_equal 'ua_vendor', d.instance.out_key_vendor
|
90
96
|
|
@@ -250,11 +256,12 @@ tag selected
|
|
250
256
|
|
251
257
|
# 'agent' => 'Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; Win64; x64; Trident/6.0)'
|
252
258
|
m = emits[0][2]
|
253
|
-
assert_equal
|
259
|
+
assert_equal 8, m.keys.size
|
254
260
|
assert_equal 0, m['value']
|
255
261
|
assert_equal 'Internet Explorer', m['ua_name']
|
256
262
|
assert_equal 'pc', m['ua_category']
|
257
263
|
assert_equal 'Windows 8', m['ua_os']
|
264
|
+
assert_equal 'NT 6.2', m['ua_os_version']
|
258
265
|
assert_equal 'Microsoft', m['ua_vendor']
|
259
266
|
assert_equal '10.0', m['ua_version']
|
260
267
|
|
@@ -264,6 +271,7 @@ tag selected
|
|
264
271
|
assert_equal 'Firefox', m['ua_name']
|
265
272
|
assert_equal 'pc', m['ua_category']
|
266
273
|
assert_equal 'Windows Vista', m['ua_os']
|
274
|
+
assert_equal 'NT 6.0', m['ua_os_version']
|
267
275
|
assert_equal 'Mozilla', m['ua_vendor']
|
268
276
|
assert_equal '9.0.1', m['ua_version']
|
269
277
|
|
@@ -273,6 +281,7 @@ tag selected
|
|
273
281
|
assert_equal 'Firefox', m['ua_name']
|
274
282
|
assert_equal 'pc', m['ua_category']
|
275
283
|
assert_equal 'Linux', m['ua_os']
|
284
|
+
assert_equal 'UNKNOWN', m['ua_os_version']
|
276
285
|
assert_equal 'Mozilla', m['ua_vendor']
|
277
286
|
assert_equal '9.0.1', m['ua_version']
|
278
287
|
|
@@ -282,6 +291,7 @@ tag selected
|
|
282
291
|
assert_equal 'Safari', m['ua_name']
|
283
292
|
assert_equal 'smartphone', m['ua_category']
|
284
293
|
assert_equal 'Android', m['ua_os']
|
294
|
+
assert_equal '3.1', m['ua_os_version']
|
285
295
|
assert_equal 'Apple', m['ua_vendor']
|
286
296
|
assert_equal '4.0', m['ua_version']
|
287
297
|
|
@@ -291,6 +301,7 @@ tag selected
|
|
291
301
|
assert_equal 'docomo', m['ua_name']
|
292
302
|
assert_equal 'mobilephone', m['ua_category']
|
293
303
|
assert_equal 'docomo', m['ua_os']
|
304
|
+
assert_equal 'UNKNOWN', m['ua_os_version']
|
294
305
|
assert_equal 'docomo', m['ua_vendor']
|
295
306
|
assert_equal 'N505i', m['ua_version']
|
296
307
|
|
@@ -300,6 +311,7 @@ tag selected
|
|
300
311
|
assert_equal 'PlayStation Vita', m['ua_name']
|
301
312
|
assert_equal 'appliance', m['ua_category']
|
302
313
|
assert_equal 'PlayStation Vita', m['ua_os']
|
314
|
+
assert_equal '1.51', m['ua_os_version']
|
303
315
|
assert_equal 'Sony', m['ua_vendor']
|
304
316
|
assert_equal 'UNKNOWN', m['ua_version']
|
305
317
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluent-plugin-woothee
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- TAGOMORI Satoshi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-03-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -24,6 +24,20 @@ dependencies:
|
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: test-unit
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 3.0.2
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 3.0.2
|
27
41
|
- !ruby/object:Gem::Dependency
|
28
42
|
name: fluentd
|
29
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -44,15 +58,15 @@ dependencies:
|
|
44
58
|
requirements:
|
45
59
|
- - ">="
|
46
60
|
- !ruby/object:Gem::Version
|
47
|
-
version: 0.
|
61
|
+
version: 1.0.0
|
48
62
|
type: :runtime
|
49
63
|
prerelease: false
|
50
64
|
version_requirements: !ruby/object:Gem::Requirement
|
51
65
|
requirements:
|
52
66
|
- - ">="
|
53
67
|
- !ruby/object:Gem::Version
|
54
|
-
version: 0.
|
55
|
-
description: 'parsing by Project Woothee. See https://github.com/
|
68
|
+
version: 1.0.0
|
69
|
+
description: 'parsing by Project Woothee. See https://github.com/woothee/woothee '
|
56
70
|
email:
|
57
71
|
- tagomoris@gmail.com
|
58
72
|
executables: []
|
@@ -69,7 +83,7 @@ files:
|
|
69
83
|
- lib/fluent/plugin/out_woothee.rb
|
70
84
|
- test/helper.rb
|
71
85
|
- test/plugin/test_out_woothee.rb
|
72
|
-
homepage: https://github.com/
|
86
|
+
homepage: https://github.com/tagomoris/fluent-plugin-woothee
|
73
87
|
licenses:
|
74
88
|
- APLv2
|
75
89
|
metadata: {}
|
@@ -89,10 +103,12 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
89
103
|
version: '0'
|
90
104
|
requirements: []
|
91
105
|
rubyforge_project:
|
92
|
-
rubygems_version: 2.
|
106
|
+
rubygems_version: 2.4.5
|
93
107
|
signing_key:
|
94
108
|
specification_version: 4
|
95
|
-
summary: Fluentd plugin to parse UserAgent strings
|
109
|
+
summary: Fluentd plugin to parse UserAgent strings with woothee parser. It adds device
|
110
|
+
information or filter records with specific device types.
|
96
111
|
test_files:
|
97
112
|
- test/helper.rb
|
98
113
|
- test/plugin/test_out_woothee.rb
|
114
|
+
has_rdoc:
|