logstash-filter-ip2proxy 2.2.0 → 2.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 87fcbfb8ff8f30359feb847bf515396a8c5438af7a311396cb6dbc9b77bc474f
4
- data.tar.gz: 15e4d42c56188f815de061d6cd7994ae0b6066dfa2243aa25aa70f58f6d787d6
3
+ metadata.gz: bf7ae72f39b3ced4e703b07a46f8d9c83fa65b65c96d0081378303eb571517e4
4
+ data.tar.gz: 6ffc47d1d0eb2e28fb505cf81565d2ddcf35f1b57fee9f6d24cfeea2ae0621c8
5
5
  SHA512:
6
- metadata.gz: 16b35d7dbd60b07518e8452584bba4925ab7596ce27a5203129ad31a045d5b43d15444da6f5d938bc7b761a2b9222c27e2e3420b4f112ff1ed120b27139033a5
7
- data.tar.gz: 84d7b726a22040872e078a8b358bef9193d88f24f2e9541ef17e2e010e89d8e58138c2069a24b8d57552a7203455ba8e1b4cbc49b8e5564e4662150903e739f3
6
+ metadata.gz: fba84548436b187387ee3979cc8b4c1f01f1f25d6e315d95aae08b4c4333b801aad16c81ed793005a8835d3412276f04219ff655df21ff9734eff24a8f2a4e67
7
+ data.tar.gz: f99eeba1722200414c16f8ebcee525905f56a2be2f75e60f374e5f0a33bf826a548c53d41808c66837ae79b806e890a60d7bdce824889a13ef1e68f9f8656986
data/README.md CHANGED
@@ -47,9 +47,11 @@ output {
47
47
  |---|---|---|
48
48
  |source|string|Yes|
49
49
  |database|a valid filesystem path|No|
50
+ |use_cache|boolean|No|
50
51
 
51
52
  * **source** field is a required setting that containing the IP address or hostname to get the ip information.
52
53
  * **database** field is an optional setting that containing the path to the IP2Proxy BIN database file.
54
+ * **use_cache** field is an optional setting that used to allow user to enable the use of cache. Default value is true.
53
55
 
54
56
 
55
57
  ## Sample Output
@@ -18,6 +18,9 @@ class LogStash::Filters::IP2Proxy < LogStash::Filters::Base
18
18
  # The field used to define iplocation as target.
19
19
  config :target, :validate => :string, :default => 'ip2proxy'
20
20
 
21
+ # The field used to allow user to enable the use of cache.
22
+ config :use_cache, :validate => :boolean, :default => true
23
+
21
24
  # The field used to define the size of the cache. It is not required and the default value is 10 000
22
25
  config :cache_size, :validate => :number, :required => false, :default => 10_000
23
26
 
@@ -41,11 +44,19 @@ class LogStash::Filters::IP2Proxy < LogStash::Filters::Base
41
44
  ip = event.get(@source)
42
45
 
43
46
  return unless filter?(event)
44
- if value = Cache.find(event, ip, @ip2proxyfilter, @cache_size).get('ip2proxy')
45
- event.set('ip2proxy', value)
46
- filter_matched(event)
47
+ if @use_cache
48
+ if value = Cache.find(event, ip, @ip2proxyfilter, @cache_size).get('ip2proxy')
49
+ event.set('ip2proxy', value)
50
+ filter_matched(event)
51
+ else
52
+ tag_iplookup_unsuccessful(event)
53
+ end
47
54
  else
48
- tag_iplookup_unsuccessful(event)
55
+ if @ip2proxyfilter.handleEvent(event)
56
+ filter_matched(event)
57
+ else
58
+ tag_iplookup_unsuccessful(event)
59
+ end
49
60
  end
50
61
  end
51
62
 
@@ -1,3 +1,3 @@
1
1
  require 'jar_dependencies'
2
2
  require_jar('com.ip2proxy.ip2proxy', 'ip2proxy', '3.1.0')
3
- require_jar('org.logstash.filters', 'logstash-filter-ip2proxy', '2.2.0')
3
+ require_jar('org.logstash.filters', 'logstash-filter-ip2proxy', '2.2.1')
@@ -1,7 +1,7 @@
1
1
  Gem::Specification.new do |s|
2
2
 
3
3
  s.name = 'logstash-filter-ip2proxy'
4
- s.version = '2.2.0'
4
+ s.version = '2.2.1'
5
5
  s.licenses = ['Apache-2.0']
6
6
  s.summary = "Logstash filter IP2Proxy"
7
7
  s.description = "IP2Proxy filter plugin for Logstash enables Logstash's users to reverse search of IP address to detect VPN servers, open proxies, web proxies, Tor exit nodes, search engine robots, data center ranges and residential proxies using IP2Proxy BIN database."
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-filter-ip2proxy
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.0
4
+ version: 2.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - IP2Location
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-09-07 00:00:00.000000000 Z
11
+ date: 2021-09-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: logstash-core-plugin-api
@@ -57,7 +57,7 @@ files:
57
57
  - spec/spec_helper.rb
58
58
  - vendor/IP2PROXY-LITE-PX1.BIN
59
59
  - vendor/jar-dependencies/com/ip2proxy/ip2proxy/ip2proxy/3.1.0/ip2proxy-3.1.0.jar
60
- - vendor/jar-dependencies/org/logstash/filters/logstash-filter-ip2proxy/2.2.0/logstash-filter-ip2proxy-2.2.0.jar
60
+ - vendor/jar-dependencies/org/logstash/filters/logstash-filter-ip2proxy/2.2.1/logstash-filter-ip2proxy-2.2.1.jar
61
61
  homepage: https://www.ip2location.com
62
62
  licenses:
63
63
  - Apache-2.0