logstash-filter-phpipam 0.7.1 → 0.7.2
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 +4 -4
- data/lib/logstash/filters/phpipam.rb +9 -5
- data/logstash-filter-phpipam.gemspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5e6e9aa1f1006988029b971ee9b1fe5ca0659d13e33551781a742ca24d8289bf
|
4
|
+
data.tar.gz: 85c6e272503003fafe0abf85a64f5acd04ae9abe5cb8bbb2d285303348bee2c2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 60a7da9f65e044265062848f8fc12ac33c836192893095cb56fb06d7f0daba058774f11abc88c27954caaef39aa3be4e96b77bbd7486bbce0f5d6eb9e1448d50
|
7
|
+
data.tar.gz: 3cdad24d903bb7922b666fbc890a0a7d6e64813f7f0ba7dbc6dc00cdc89e23ba8e266b6465a504d6a7e699e97af10ee5e7c8e628a6af35ca0fdefb4a41391731
|
@@ -218,17 +218,21 @@ class LogStash::Filters::Phpipam < LogStash::Filters::Base
|
|
218
218
|
base['device']['name'] = device_data['hostname'] unless nil_or_empty?(device_data['hostname'])
|
219
219
|
base['device']['description'] = device_data['description'] unless nil_or_empty?(device_data['description'])
|
220
220
|
base['device']['type'] = type['tname'] unless nil_or_empty?(type['tname'])
|
221
|
+
end
|
221
222
|
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
223
|
+
# If the IP doesn't have the location directly, try to get it from the device or subnet
|
224
|
+
unless okay?(location_data)
|
225
|
+
location_data = if okay?(device_data) && device_data['location'] != '0' && !nil_or_empty?(device_data['location'])
|
226
|
+
send_rest_request('GET', "api/#{@app_id}/tools/locations/#{device_data['location']}/")
|
227
|
+
elsif okay?(subnet_data) && subnet_data['location'] != '0' && !nil_or_empty?(subnet_data['location'])
|
228
|
+
send_rest_request('GET', "api/#{@app_id}/tools/locations/#{subnet_data['location']}/")
|
229
|
+
end
|
226
230
|
end
|
227
231
|
|
228
232
|
# Location information
|
229
233
|
if okay?(location_data)
|
230
234
|
base['location'] = {}
|
231
|
-
base['location']['id'] =
|
235
|
+
base['location']['id'] = location_data['id'].to_i
|
232
236
|
base['location']['address'] = location_data['address'] unless nil_or_empty?(location_data['address'])
|
233
237
|
base['location']['name'] = location_data['name'] unless nil_or_empty?(location_data['name'])
|
234
238
|
base['location']['description'] = location_data['description'] unless nil_or_empty?(location_data['description'])
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = 'logstash-filter-phpipam'
|
5
|
-
s.version = '0.7.
|
5
|
+
s.version = '0.7.2'
|
6
6
|
s.licenses = ['Apache-2.0']
|
7
7
|
s.summary = 'A Logstash filter that returns results from phpIPAM'
|
8
8
|
s.description = 'A Logstash filter that looks up an IP-address, and returns results from phpIPAM'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: logstash-filter-phpipam
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- magnuslarsen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-08-
|
11
|
+
date: 2019-08-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: logstash-core-plugin-api
|