forked from elastic/elasticsearch
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a yamlRestTest of the ip_location processor
- Loading branch information
Showing
1 changed file
with
45 additions
and
0 deletions.
There are no files selected for viewing
45 changes: 45 additions & 0 deletions
45
...oip/src/yamlRestTest/resources/rest-api-spec/test/ingest_geoip/50_ip_lookup_processor.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
setup: | ||
- requires: | ||
cluster_features: | ||
- "put_database_configuration_action.ipinfo" | ||
reason: "ipinfo support added in 8.16" | ||
|
||
--- | ||
"Test ip_location processor with defaults": | ||
- do: | ||
ingest.put_pipeline: | ||
id: "my_pipeline" | ||
body: > | ||
{ | ||
"description": "_description", | ||
"processors": [ | ||
{ | ||
"ip_location" : { | ||
"field" : "field1" | ||
} | ||
} | ||
] | ||
} | ||
- match: { acknowledged: true } | ||
|
||
- do: | ||
index: | ||
index: test | ||
id: "1" | ||
pipeline: "my_pipeline" | ||
body: {field1: "89.160.20.128"} | ||
|
||
- do: | ||
get: | ||
index: test | ||
id: "1" | ||
- match: { _source.field1: "89.160.20.128" } | ||
- length: { _source.ip_location: 7 } | ||
- match: { _source.ip_location.city_name: "Linköping" } | ||
- match: { _source.ip_location.country_iso_code: "SE" } | ||
- match: { _source.ip_location.location.lon: 15.6167 } | ||
- match: { _source.ip_location.location.lat: 58.4167 } | ||
- match: { _source.ip_location.region_iso_code: "SE-E" } | ||
- match: { _source.ip_location.country_name: "Sweden" } | ||
- match: { _source.ip_location.region_name: "Östergötland County" } | ||
- match: { _source.ip_location.continent_name: "Europe" } |