logstash-filter-ip2location 2.3.0 → 2.3.2
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 -0
- data/lib/logstash/filters/ip2location.rb +5 -5
- data/lib/logstash-filter-ip2location_jars.rb +2 -2
- data/logstash-filter-ip2location.gemspec +1 -1
- data/vendor/jar-dependencies/com/ip2location/ip2location/ip2location/8.9.1/ip2location-8.9.1.jar +0 -0
- data/vendor/jar-dependencies/org/logstash/filters/logstash-filter-ip2location/2.3.2/logstash-filter-ip2location-2.3.2.jar +0 -0
- metadata +8 -9
- data/vendor/jar-dependencies/com/ip2location/ip2location/ip2location/8.7.0/ip2location-8.7.0.jar +0 -0
- data/vendor/jar-dependencies/org/logstash/filters/logstash-filter-ip2location/2.3.0/logstash-filter-ip2location-2.3.0.jar +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: afe979aa5f73816b4383418427c95493eb318c49f464649e6f99d9f2875789be
|
4
|
+
data.tar.gz: 6a0a4b553978aa7b16a8a9de76409a4a123d37b3472eeb3869884d685dc170c3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fa385ec640bef0c383e418dc77ceada8cbcd5bfcc1e43175ca406bdb18281e565b1ea2c8969a231545dd2712b46bdb55a394f59b8143f4738d1b5676f457c9a5
|
7
|
+
data.tar.gz: 91c240e70faf07c36e29b504dbab6f133ee6351f8116793e04f3c6c8fa136eaebf6fab660a8bc45e20cf3c8789746715c6452dffc51bb6f270d1afac27dafb75
|
data/README.md
CHANGED
@@ -5,6 +5,8 @@ Supported IPv4 and IPv6 address.
|
|
5
5
|
|
6
6
|
For the methods to use IP2Location filter plugin with Elastic Stack (Elasticsearch, Filebeat, Logstash, and Kibana), please take a look on this [tutorial](https://www.ip2location.com/tutorials/how-to-use-ip2location-filter-plugin-with-elastic-stack).
|
7
7
|
|
8
|
+
*Note: This plugin works in Logstash 7 and Logstash 8.*
|
9
|
+
|
8
10
|
|
9
11
|
## Dependencies (IP2LOCATION BIN DATA FILE)
|
10
12
|
This plugin requires IP2Location BIN data file to function. You may download the BIN data file at
|
@@ -54,7 +54,7 @@ class LogStash::Filters::IP2Location < LogStash::Filters::Base
|
|
54
54
|
|
55
55
|
return unless filter?(event)
|
56
56
|
if @use_cache
|
57
|
-
if value =
|
57
|
+
if value = IP2LocationCache.find(event, ip, @ip2locationfilter, @cache_size).get('ip2location')
|
58
58
|
event.set('ip2location', value)
|
59
59
|
filter_matched(event)
|
60
60
|
else
|
@@ -75,7 +75,7 @@ class LogStash::Filters::IP2Location < LogStash::Filters::Base
|
|
75
75
|
|
76
76
|
end # class LogStash::Filters::IP2Location
|
77
77
|
|
78
|
-
class
|
78
|
+
class IP2LocationOrderedHash
|
79
79
|
ONE = 1
|
80
80
|
|
81
81
|
attr_reader :times_queried # ip -> times queried
|
@@ -117,12 +117,12 @@ class OrderedHash
|
|
117
117
|
end
|
118
118
|
end
|
119
119
|
|
120
|
-
class
|
120
|
+
class IP2LocationCache
|
121
121
|
ONE_DAY_IN_SECONDS = 86_400
|
122
122
|
|
123
123
|
@cache = {} # ip -> event
|
124
124
|
@timestamps = {} # ip -> time of caching
|
125
|
-
@times_queried =
|
125
|
+
@times_queried = IP2LocationOrderedHash.new # ip -> times queried
|
126
126
|
@mutex = Mutex.new
|
127
127
|
|
128
128
|
class << self
|
@@ -137,7 +137,7 @@ class Cache
|
|
137
137
|
refresh_event(event, ip, filter) if too_old?(ip)
|
138
138
|
else
|
139
139
|
if cache_full?(cache_size)
|
140
|
-
make_room
|
140
|
+
make_room
|
141
141
|
end
|
142
142
|
cache_event(event, ip, filter)
|
143
143
|
end
|
@@ -1,3 +1,3 @@
|
|
1
1
|
require 'jar_dependencies'
|
2
|
-
require_jar('com.ip2location.ip2location', 'ip2location', '8.
|
3
|
-
require_jar('org.logstash.filters', 'logstash-filter-ip2location', '2.3.
|
2
|
+
require_jar('com.ip2location.ip2location', 'ip2location', '8.9.1')
|
3
|
+
require_jar('org.logstash.filters', 'logstash-filter-ip2location', '2.3.2')
|
@@ -1,7 +1,7 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
|
3
3
|
s.name = 'logstash-filter-ip2location'
|
4
|
-
s.version = '2.3.
|
4
|
+
s.version = '2.3.2'
|
5
5
|
s.licenses = ['Apache License (2.0)']
|
6
6
|
s.summary = "Logstash filter IP2Location"
|
7
7
|
s.description = "IP2Location filter plugin for Logstash enables Logstash's users to add geolocation information such as country, state, city, latitude, longitude, ZIP code, time zone, ISP, domain name, connection speed, IDD code, area code, weather station code, weather station name, MNC, MCC, mobile brand, elevation and usage type by IP address."
|
data/vendor/jar-dependencies/com/ip2location/ip2location/ip2location/8.9.1/ip2location-8.9.1.jar
ADDED
Binary file
|
Binary file
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: logstash-filter-ip2location
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.3.
|
4
|
+
version: 2.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- IP2Location
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-10-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: logstash-core-plugin-api
|
@@ -57,15 +57,15 @@ files:
|
|
57
57
|
- spec/filters/ip2location_spec.rb
|
58
58
|
- spec/spec_helper.rb
|
59
59
|
- vendor/IP2LOCATION-LITE-DB1.IPV6.BIN
|
60
|
-
- vendor/jar-dependencies/com/ip2location/ip2location/ip2location/8.
|
61
|
-
- vendor/jar-dependencies/org/logstash/filters/logstash-filter-ip2location/2.3.
|
60
|
+
- vendor/jar-dependencies/com/ip2location/ip2location/ip2location/8.9.1/ip2location-8.9.1.jar
|
61
|
+
- vendor/jar-dependencies/org/logstash/filters/logstash-filter-ip2location/2.3.2/logstash-filter-ip2location-2.3.2.jar
|
62
62
|
homepage: https://www.ip2location.com
|
63
63
|
licenses:
|
64
64
|
- Apache License (2.0)
|
65
65
|
metadata:
|
66
66
|
logstash_plugin: 'true'
|
67
67
|
logstash_group: filter
|
68
|
-
post_install_message:
|
68
|
+
post_install_message:
|
69
69
|
rdoc_options: []
|
70
70
|
require_paths:
|
71
71
|
- lib
|
@@ -81,9 +81,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0'
|
83
83
|
requirements: []
|
84
|
-
|
85
|
-
|
86
|
-
signing_key:
|
84
|
+
rubygems_version: 3.3.7
|
85
|
+
signing_key:
|
87
86
|
specification_version: 4
|
88
87
|
summary: Logstash filter IP2Location
|
89
88
|
test_files:
|