Skip to content

Commit 556d303

Browse files
nickpeihlkcm
authored andcommitted
Update geolite2 database in ingest geoip plugin (#33840)
* Update geolite2 database in ingest geoip plugin * Fix integration tests
1 parent 9134bb3 commit 556d303

File tree

3 files changed

+15
-15
lines changed

3 files changed

+15
-15
lines changed

plugins/ingest-geoip/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ dependencies {
3030
compile("com.fasterxml.jackson.core:jackson-databind:${versions.jackson}")
3131
compile('com.maxmind.db:maxmind-db:1.2.2')
3232

33-
testCompile 'org.elasticsearch:geolite2-databases:20180303'
33+
testCompile 'org.elasticsearch:geolite2-databases:20180911'
3434
}
3535

3636
task copyDefaultGeoIp2DatabaseFiles(type: Copy) {

plugins/ingest-geoip/src/test/java/org/elasticsearch/ingest/geoip/GeoIpProcessorTests.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,8 @@ public void testCity_withIpV6() throws Exception {
134134
assertThat(geoData.get("city_name"), equalTo("Hollywood"));
135135
assertThat(geoData.get("timezone"), equalTo("America/New_York"));
136136
Map<String, Object> location = new HashMap<>();
137-
location.put("lat", 26.0252d);
138-
location.put("lon", -80.296d);
137+
location.put("lat", 25.9825d);
138+
location.put("lon", -80.3434d);
139139
assertThat(geoData.get("location"), equalTo(location));
140140
}
141141

@@ -197,7 +197,7 @@ public void testCountryWithMissingLocation() throws Exception {
197197
}
198198

199199
public void testAsn() throws Exception {
200-
String ip = "82.170.213.79";
200+
String ip = "82.171.64.0";
201201
InputStream database = getDatabaseFileInputStream("/GeoLite2-ASN.mmdb");
202202
GeoIpProcessor processor = new GeoIpProcessor(randomAlphaOfLength(10), "source_field",
203203
new DatabaseReader.Builder(database).build(), "target_field", EnumSet.allOf(GeoIpProcessor.Property.class), false,
@@ -213,7 +213,7 @@ public void testAsn() throws Exception {
213213
Map<String, Object> geoData = (Map<String, Object>) ingestDocument.getSourceAndMetadata().get("target_field");
214214
assertThat(geoData.size(), equalTo(3));
215215
assertThat(geoData.get("ip"), equalTo(ip));
216-
assertThat(geoData.get("asn"), equalTo(5615));
216+
assertThat(geoData.get("asn"), equalTo(1136));
217217
assertThat(geoData.get("organization_name"), equalTo("KPN B.V."));
218218
}
219219

plugins/ingest-geoip/src/test/resources/rest-api-spec/test/ingest_geoip/20_geoip_processor.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@
3333
- length: { _source.geoip: 6 }
3434
- match: { _source.geoip.city_name: "Minneapolis" }
3535
- match: { _source.geoip.country_iso_code: "US" }
36-
- match: { _source.geoip.location.lon: -93.2166 }
37-
- match: { _source.geoip.location.lat: 44.9759 }
36+
- match: { _source.geoip.location.lon: -93.2323 }
37+
- match: { _source.geoip.location.lat: 44.9733 }
3838
- match: { _source.geoip.region_iso_code: "US-MN" }
3939
- match: { _source.geoip.region_name: "Minnesota" }
4040
- match: { _source.geoip.continent_name: "North America" }
@@ -80,8 +80,8 @@
8080
- match: { _source.geoip.city_name: "Minneapolis" }
8181
- match: { _source.geoip.country_iso_code: "US" }
8282
- match: { _source.geoip.ip: "128.101.101.101" }
83-
- match: { _source.geoip.location.lon: -93.2166 }
84-
- match: { _source.geoip.location.lat: 44.9759 }
83+
- match: { _source.geoip.location.lon: -93.2323 }
84+
- match: { _source.geoip.location.lat: 44.9733 }
8585
- match: { _source.geoip.timezone: "America/Chicago" }
8686
- match: { _source.geoip.country_name: "United States" }
8787
- match: { _source.geoip.region_iso_code: "US-MN" }
@@ -193,8 +193,8 @@
193193
- length: { _source.geoip: 6 }
194194
- match: { _source.geoip.city_name: "Minneapolis" }
195195
- match: { _source.geoip.country_iso_code: "US" }
196-
- match: { _source.geoip.location.lon: -93.2166 }
197-
- match: { _source.geoip.location.lat: 44.9759 }
196+
- match: { _source.geoip.location.lon: -93.2323 }
197+
- match: { _source.geoip.location.lat: 44.9733 }
198198
- match: { _source.geoip.region_iso_code: "US-MN" }
199199
- match: { _source.geoip.region_name: "Minnesota" }
200200
- match: { _source.geoip.continent_name: "North America" }
@@ -224,15 +224,15 @@
224224
type: test
225225
id: 1
226226
pipeline: "my_pipeline"
227-
body: {field1: "82.170.213.79"}
227+
body: {field1: "82.171.64.0"}
228228

229229
- do:
230230
get:
231231
index: test
232232
type: test
233233
id: 1
234-
- match: { _source.field1: "82.170.213.79" }
234+
- match: { _source.field1: "82.171.64.0" }
235235
- length: { _source.geoip: 3 }
236-
- match: { _source.geoip.ip: "82.170.213.79" }
237-
- match: { _source.geoip.asn: 5615 }
236+
- match: { _source.geoip.ip: "82.171.64.0" }
237+
- match: { _source.geoip.asn: 1136 }
238238
- match: { _source.geoip.organization_name: "KPN B.V." }

0 commit comments

Comments
 (0)