logstash-filter-handsetdetection 4.1.6 → 4.1.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/logstash/filters/handsetdetection.rb +21 -0
- data/logstash-filter-handsetdetection.gemspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 667cf7455d28f8bf1ccfbf50ff15cdb418976b37
|
4
|
+
data.tar.gz: 270a1da8644f3d9c63287376629f540f2b222754
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 532cc79fa013ce4a1718fd9b65ba5310ec9e8812e63328665c080192fb7e94a075e85bf68101bab5af1cd624ae899a481cad6671f7c9e4562e8732ebb64e2b09
|
7
|
+
data.tar.gz: 108ee6680452a6c1b61c3c267fe2d6fe8077187a95a0d2c02e1812b16031b619dea4934223ea506c4896fc0cf909e4b9462d99833fcbbebbba76e33cb85f53eb
|
@@ -117,6 +117,7 @@ class LogStash::Filters::HandsetDetection < LogStash::Filters::Base
|
|
117
117
|
event.set '[handset_detection][message]', r['message']
|
118
118
|
end
|
119
119
|
if r.key? 'hd_specs'
|
120
|
+
r['hd_specs'] = add_convenience_fields r['hd_specs']
|
120
121
|
if @filter.empty?
|
121
122
|
event.set '[handset_detection][specs]', r['hd_specs']
|
122
123
|
else
|
@@ -134,4 +135,24 @@ class LogStash::Filters::HandsetDetection < LogStash::Filters::Base
|
|
134
135
|
end
|
135
136
|
filter_matched event
|
136
137
|
end
|
138
|
+
|
139
|
+
def add_convenience_fields(specs)
|
140
|
+
unless specs.key? 'general_device_name'
|
141
|
+
if specs.key? 'general_aliases' and specs['general_aliases'].is_a? Array and specs['general_aliases'].count > 0
|
142
|
+
specs['general_device_name'] = specs['general_aliases'][0].strip
|
143
|
+
else
|
144
|
+
specs['general_device_name'] = "#{specs.fetch('general_vendor', '')} #{specs.fetch('general_model', '')}".strip
|
145
|
+
end
|
146
|
+
end
|
147
|
+
unless specs.key? 'general_platform_name'
|
148
|
+
specs['general_platform_name'] = "#{specs.fetch('general_platform', '')} #{specs.fetch('general_platform_version', '')}".strip
|
149
|
+
end
|
150
|
+
unless specs.key? 'general_browser_name'
|
151
|
+
specs['general_browser_name'] = "#{specs.fetch('general_browser', '')} #{specs.fetch('general_browser_version', '')}".strip
|
152
|
+
end
|
153
|
+
unless specs.key? 'general_app_name'
|
154
|
+
specs['general_app_name'] = "#{specs.fetch('general_app', '')} #{specs.fetch('general_app_version', '')}".strip
|
155
|
+
end
|
156
|
+
specs
|
157
|
+
end
|
137
158
|
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'logstash-filter-handsetdetection'
|
3
|
-
s.version = '4.1.
|
3
|
+
s.version = '4.1.7'
|
4
4
|
s.licenses = ['MIT']
|
5
5
|
s.summary = "Handset Detection filter plugin for Logstash"
|
6
6
|
s.description = "This gem is a Logstash plugin required to be installed on top of the Logstash core pipeline using $LS_HOME/bin/logstash-plugin install gemname. This gem is not a stand-alone program"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: logstash-filter-handsetdetection
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.1.
|
4
|
+
version: 4.1.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Handset Detection
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-02-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: logstash-core-plugin-api
|