logstash-filter-ip2location 2.0.2 → 2.1.0

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: 2fa86b9c0eb8143712f4d38ba1fa6fdeddfe6a2307f7878dab8941fdae597680
4
- data.tar.gz: e16e80d2b68d11051ab71f186203f5c5d82877810ad5e6b8faa164c946c4464e
3
+ metadata.gz: 27a17e80a91f7851d74d81f9133e3e8c9a158c4ff9607a64559a7476e25e53d7
4
+ data.tar.gz: 4f98d7be4142a976fe1990cfa03d274040f07f76607508dff6523db66a2026a3
5
5
  SHA512:
6
- metadata.gz: 868c5ba3c29ad98b5b4fc0e55a9a6bb0b493394abda42d7809b239a96f9ad65cdf5efb5847706c7fff47ec594b0e6a329c74a2bbcdb97388461c69a9f41e329b
7
- data.tar.gz: 2804e949d4e713e36a24ab82794992593ae8f7fb4f904086483573f70dc63f6662201f9de6bc1b7855bc1fb0d5000d4e7c8814f1687e29b7f1561619912d3e38
6
+ metadata.gz: 8e94f8df4be01df8a1f0667e4122e372f0ab44315f1e96cffe0a5650b6266e54e1830530a8e121300161bfeddb989a002a553a55e3ad151e7c8d99a139bb754b
7
+ data.tar.gz: 3c27ab7ef7ab6204a2f7c1c2018a33bc9d939d647c0f4a9e8ef7937b8e8c3f84ebefafa0a20491a9fa7792d7c13b00deb66de7974a12648623c744f539a4b38f
data/README.md CHANGED
@@ -19,7 +19,7 @@ bin/logstash-plugin install logstash-filter-ip2location
19
19
  ```
20
20
 
21
21
 
22
- ## Config File Example
22
+ ## Config File Example 1
23
23
  ```
24
24
  input {
25
25
  beats {
@@ -45,6 +45,36 @@ output {
45
45
  ```
46
46
 
47
47
 
48
+ ## Config File Example 2
49
+ ```
50
+ input {
51
+ beats {
52
+ port => "5043"
53
+ }
54
+ }
55
+
56
+ filter {
57
+ grok {
58
+ match => { "message" => "%{COMBINEDAPACHELOG}"}
59
+ }
60
+ ip2location {
61
+ source => "clientip"
62
+ # Set path to the database located
63
+ database => "IP2LOCATION_BIN_DATABASE_FILESYSTEM_PATH"
64
+ # Enable memory mapped to be used
65
+ use_memory_mapped => true
66
+ }
67
+ }
68
+
69
+
70
+ output {
71
+ elasticsearch {
72
+ hosts => [ "localhost:9200" ]
73
+ }
74
+ }
75
+ ```
76
+
77
+
48
78
  ## IP2Location Filter Configuration
49
79
  |Setting|Input type|Required|
50
80
  |---|---|---|
@@ -82,7 +112,7 @@ output {
82
112
  |ip2location.weather_station_name|the name of the nearest weather observation station|
83
113
  |ip2location.zip_code|the ZIP code|
84
114
 
85
- ![Example of data](https://www.ip2location.com/images/tutorial/logstash-filter-ip2location-screenshot2.png?)
115
+ ![Example of data](https://www.ip2location.com/assets/img/logstash-filter-ip2location-screenshot2.png)
86
116
 
87
117
 
88
118
  ## Support
@@ -1,3 +1,3 @@
1
1
  require 'jar_dependencies'
2
- require_jar('com.ip2location.ip2location', 'ip2location', '8.0.3')
3
- require_jar('org.logstash.filters', 'logstash-filter-ip2location', '2.0.2')
2
+ require_jar('com.ip2location.ip2location', 'ip2location', '8.1.0')
3
+ require_jar('org.logstash.filters', 'logstash-filter-ip2location', '2.1.0')
@@ -3,7 +3,6 @@ require "logstash/filters/base"
3
3
  require "logstash/namespace"
4
4
 
5
5
  require "logstash-filter-ip2location_jars"
6
- require "json"
7
6
 
8
7
  require 'thread'
9
8
 
@@ -45,8 +44,7 @@ class LogStash::Filters::IP2Location < LogStash::Filters::Base
45
44
 
46
45
  public
47
46
  def filter(event)
48
- json = JSON.parse(event.to_json)
49
- ip = json[@source]
47
+ ip = event.get(@source)
50
48
 
51
49
  return unless filter?(event)
52
50
  if value = Cache.find(event, ip, @ip2locationfilter, @cache_size).get('ip2location')
@@ -1,7 +1,7 @@
1
1
  Gem::Specification.new do |s|
2
2
 
3
3
  s.name = 'logstash-filter-ip2location'
4
- s.version = '2.0.2'
4
+ s.version = '2.1.0'
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."
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.0.2
4
+ version: 2.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - IP2Location
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-10-16 00:00:00.000000000 Z
11
+ date: 2019-09-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: logstash-core-plugin-api
@@ -57,8 +57,8 @@ files:
57
57
  - spec/filters/ip2location_spec.rb
58
58
  - spec/spec_helper.rb
59
59
  - vendor/IP2LOCATION-LITE-DB3.IPV6.BIN
60
- - vendor/jar-dependencies/com/ip2location/ip2location/ip2location/8.0.3/ip2location-8.0.3.jar
61
- - vendor/jar-dependencies/org/logstash/filters/logstash-filter-ip2location/2.0.2/logstash-filter-ip2location-2.0.2.jar
60
+ - vendor/jar-dependencies/com/ip2location/ip2location/ip2location/8.1.0/ip2location-8.1.0.jar
61
+ - vendor/jar-dependencies/org/logstash/filters/logstash-filter-ip2location/2.1.0/logstash-filter-ip2location-2.1.0.jar
62
62
  homepage: https://www.ip2location.com
63
63
  licenses:
64
64
  - Apache License (2.0)
@@ -81,8 +81,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
83
  requirements: []
84
- rubyforge_project:
85
- rubygems_version: 2.7.7
84
+ rubygems_version: 3.0.3
86
85
  signing_key:
87
86
  specification_version: 4
88
87
  summary: Logstash filter IP2Location