logstash-filter-ip2proxy 2.2.0 → 2.3.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: 481763ee546214cc2d2085deb0fd817309bc135fbbc37f5db35cd490b45ce387
4
+ data.tar.gz: 932e39ad6bac7204f978c4762552adfec12d84a0fe0596af10ea5543f0359382
5
5
  SHA512:
6
- metadata.gz: 16b35d7dbd60b07518e8452584bba4925ab7596ce27a5203129ad31a045d5b43d15444da6f5d938bc7b761a2b9222c27e2e3420b4f112ff1ed120b27139033a5
7
- data.tar.gz: 84d7b726a22040872e078a8b358bef9193d88f24f2e9541ef17e2e010e89d8e58138c2069a24b8d57552a7203455ba8e1b4cbc49b8e5564e4662150903e739f3
6
+ metadata.gz: 34827f591d9df130d9c548b48dfd15e0bf0b00035ed5f477b29c7632dd5f5ba2c7a3472684c2077ff73a8eede04acff9f0470e468054699d2cdafdda3225d7d5
7
+ data.tar.gz: 1e4cdebc1c1ea291abde014c010e8e26d6d873984f8e51bd3b4c98db0698230d571984b0b0724908f4bc32680a9688c0200ce98e5eaec8a91f24d45bccc14e20
data/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2021 IP2Location.com
1
+ Copyright (c) 2022 IP2Location.com
2
2
 
3
3
  Licensed under the Apache License, Version 2.0 (the "License");
4
4
  you may not use this file except in compliance with the License.
data/README.md CHANGED
@@ -3,6 +3,8 @@ This is IP2Proxy filter plugin for Logstash that enables Logstash's users to rev
3
3
 
4
4
  For the methods to use IP2Proxy filter plugin with Elastic Stack (Elasticsearch, Filebeat, Logstash, and Kibana), please take a look on this [tutorial](https://blog.ip2location.com/knowledge-base/how-to-use-ip2proxy-filter-plugin-with-elastic-stack).
5
5
 
6
+ *Note: This plugin works in Logstash 7 and Logstash 8.*
7
+
6
8
 
7
9
  ## Dependencies (IP2PROXY BIN DATA FILE)
8
10
  This plugin requires IP2Proxy BIN data file to function. You may download the BIN data file at
@@ -47,9 +49,15 @@ output {
47
49
  |---|---|---|
48
50
  |source|string|Yes|
49
51
  |database|a valid filesystem path|No|
52
+ |use_memory_mapped|boolean|No|
53
+ |use_cache|boolean|No|
54
+ |hide_unsupported_fields|boolean|No|
50
55
 
51
56
  * **source** field is a required setting that containing the IP address or hostname to get the ip information.
52
57
  * **database** field is an optional setting that containing the path to the IP2Proxy BIN database file.
58
+ * **use_memory_mapped** field is an optional setting that used to allow user to enable the use of memory mapped file. Default value is false.
59
+ * **use_cache** field is an optional setting that used to allow user to enable the use of cache. Default value is true.
60
+ * **hide_unsupported_fields** field is an optional setting that used to allow user to hide unsupported fields. Default value is false.
53
61
 
54
62
 
55
63
  ## Sample Output
@@ -8,7 +8,7 @@ class LogStash::Filters::IP2Proxy < LogStash::Filters::Base
8
8
  config_name "ip2proxy"
9
9
 
10
10
  # The path to the IP2Proxy.BIN database file which Logstash should use.
11
- # If not specified, this will default to the IP2PROXY-LITE-PX4.BIN database that embedded in the plugin.
11
+ # If not specified, this will default to the IP2PROXY-LITE-PX1.BIN database that embedded in the plugin.
12
12
  config :database, :validate => :path
13
13
 
14
14
  # The field containing the IP address.
@@ -18,6 +18,15 @@ 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
+
24
+ # The field used to allow user to enable the use of memory mapped file.
25
+ config :use_memory_mapped, :validate => :boolean, :default => false
26
+
27
+ # The field used to allow user to hide unsupported fields.
28
+ config :hide_unsupported_fields, :validate => :boolean, :default => false
29
+
21
30
  # The field used to define the size of the cache. It is not required and the default value is 10 000
22
31
  config :cache_size, :validate => :number, :required => false, :default => 10_000
23
32
 
@@ -32,8 +41,8 @@ class LogStash::Filters::IP2Proxy < LogStash::Filters::Base
32
41
  end
33
42
 
34
43
  @logger.info("Using ip2proxy database", :path => @database)
35
-
36
- @ip2proxyfilter = org.logstash.filters.IP2ProxyFilter.new(@source, @target, @database)
44
+
45
+ @ip2proxyfilter = org.logstash.filters.IP2ProxyFilter.new(@source, @target, @database, @use_memory_mapped, @hide_unsupported_fields)
37
46
  end
38
47
 
39
48
  public
@@ -41,11 +50,19 @@ class LogStash::Filters::IP2Proxy < LogStash::Filters::Base
41
50
  ip = event.get(@source)
42
51
 
43
52
  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)
53
+ if @use_cache
54
+ if value = Cache.find(event, ip, @ip2proxyfilter, @cache_size).get('ip2proxy')
55
+ event.set('ip2proxy', value)
56
+ filter_matched(event)
57
+ else
58
+ tag_iplookup_unsuccessful(event)
59
+ end
47
60
  else
48
- tag_iplookup_unsuccessful(event)
61
+ if @ip2proxyfilter.handleEvent(event)
62
+ filter_matched(event)
63
+ else
64
+ tag_iplookup_unsuccessful(event)
65
+ end
49
66
  end
50
67
  end
51
68
 
@@ -1,3 +1,3 @@
1
1
  require 'jar_dependencies'
2
- require_jar('com.ip2proxy.ip2proxy', 'ip2proxy', '3.1.0')
3
- require_jar('org.logstash.filters', 'logstash-filter-ip2proxy', '2.2.0')
2
+ require_jar('com.ip2proxy.ip2proxy', 'ip2proxy', '3.4.0')
3
+ require_jar('org.logstash.filters', 'logstash-filter-ip2proxy', '2.3.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.3.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.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - IP2Location
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-09-07 00:00:00.000000000 Z
11
+ date: 2022-07-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: logstash-core-plugin-api
@@ -56,15 +56,15 @@ files:
56
56
  - spec/filters/ip2proxy_spec.rb
57
57
  - spec/spec_helper.rb
58
58
  - vendor/IP2PROXY-LITE-PX1.BIN
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
59
+ - vendor/jar-dependencies/com/ip2proxy/ip2proxy/ip2proxy/3.4.0/ip2proxy-3.4.0.jar
60
+ - vendor/jar-dependencies/org/logstash/filters/logstash-filter-ip2proxy/2.3.1/logstash-filter-ip2proxy-2.3.1.jar
61
61
  homepage: https://www.ip2location.com
62
62
  licenses:
63
63
  - Apache-2.0
64
64
  metadata:
65
65
  logstash_plugin: 'true'
66
66
  logstash_group: filter
67
- post_install_message:
67
+ post_install_message:
68
68
  rdoc_options: []
69
69
  require_paths:
70
70
  - lib
@@ -80,9 +80,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
80
80
  - !ruby/object:Gem::Version
81
81
  version: '0'
82
82
  requirements: []
83
- rubyforge_project:
84
- rubygems_version: 2.7.6.2
85
- signing_key:
83
+ rubygems_version: 3.2.33
84
+ signing_key:
86
85
  specification_version: 4
87
86
  summary: Logstash filter IP2Proxy
88
87
  test_files: