Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion plugins/ingest-geoip/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ dependencies {
compile("com.fasterxml.jackson.core:jackson-databind:${versions.jackson}")
compile('com.maxmind.db:maxmind-db:1.2.2')

testCompile 'org.elasticsearch:geolite2-databases:20180303'
testCompile 'org.elasticsearch:geolite2-databases:20180911'
}

task copyDefaultGeoIp2DatabaseFiles(type: Copy) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,8 @@ public void testCity_withIpV6() throws Exception {
assertThat(geoData.get("city_name"), equalTo("Hollywood"));
assertThat(geoData.get("timezone"), equalTo("America/New_York"));
Map<String, Object> location = new HashMap<>();
location.put("lat", 26.0252d);
location.put("lon", -80.296d);
location.put("lat", 25.9825d);
location.put("lon", -80.3434d);
assertThat(geoData.get("location"), equalTo(location));
}

Expand Down Expand Up @@ -197,7 +197,7 @@ public void testCountryWithMissingLocation() throws Exception {
}

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
- length: { _source.geoip: 6 }
- match: { _source.geoip.city_name: "Minneapolis" }
- match: { _source.geoip.country_iso_code: "US" }
- match: { _source.geoip.location.lon: -93.2166 }
- match: { _source.geoip.location.lat: 44.9759 }
- match: { _source.geoip.location.lon: -93.2323 }
- match: { _source.geoip.location.lat: 44.9733 }
- match: { _source.geoip.region_iso_code: "US-MN" }
- match: { _source.geoip.region_name: "Minnesota" }
- match: { _source.geoip.continent_name: "North America" }
Expand Down Expand Up @@ -80,8 +80,8 @@
- match: { _source.geoip.city_name: "Minneapolis" }
- match: { _source.geoip.country_iso_code: "US" }
- match: { _source.geoip.ip: "128.101.101.101" }
- match: { _source.geoip.location.lon: -93.2166 }
- match: { _source.geoip.location.lat: 44.9759 }
- match: { _source.geoip.location.lon: -93.2323 }
- match: { _source.geoip.location.lat: 44.9733 }
- match: { _source.geoip.timezone: "America/Chicago" }
- match: { _source.geoip.country_name: "United States" }
- match: { _source.geoip.region_iso_code: "US-MN" }
Expand Down Expand Up @@ -193,8 +193,8 @@
- length: { _source.geoip: 6 }
- match: { _source.geoip.city_name: "Minneapolis" }
- match: { _source.geoip.country_iso_code: "US" }
- match: { _source.geoip.location.lon: -93.2166 }
- match: { _source.geoip.location.lat: 44.9759 }
- match: { _source.geoip.location.lon: -93.2323 }
- match: { _source.geoip.location.lat: 44.9733 }
- match: { _source.geoip.region_iso_code: "US-MN" }
- match: { _source.geoip.region_name: "Minnesota" }
- match: { _source.geoip.continent_name: "North America" }
Expand Down Expand Up @@ -224,15 +224,15 @@
type: test
id: 1
pipeline: "my_pipeline"
body: {field1: "82.170.213.79"}
body: {field1: "82.171.64.0"}

- do:
get:
index: test
type: test
id: 1
- match: { _source.field1: "82.170.213.79" }
- match: { _source.field1: "82.171.64.0" }
- length: { _source.geoip: 3 }
- match: { _source.geoip.ip: "82.170.213.79" }
- match: { _source.geoip.asn: 5615 }
- match: { _source.geoip.ip: "82.171.64.0" }
- match: { _source.geoip.asn: 1136 }
- match: { _source.geoip.organization_name: "KPN B.V." }