-
Notifications
You must be signed in to change notification settings - Fork 141
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Andy Kwok <[email protected]>
- Loading branch information
1 parent
2a89d8e
commit 6138a91
Showing
3 changed files
with
41 additions
and
0 deletions.
There are no files selected for viewing
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
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,38 @@ | ||
==================== | ||
Geo IP Address Functions | ||
==================== | ||
|
||
.. rubric:: Table of contents | ||
|
||
.. contents:: | ||
:local: | ||
:depth: 1 | ||
|
||
CIDRMATCH | ||
--------- | ||
|
||
Description | ||
>>>>>>>>>>> | ||
|
||
Usage: `geoip(dataSourceName, ipAddress, options)` to lookup location information from given IP addresses via OpenSearch GeoSpatial plugin API. | ||
|
||
Argument type: STRING, STRING, STRING | ||
|
||
Return type: Tuple | ||
|
||
Example: | ||
|
||
os> source=weblogs | eval LookupResult = geoip("dataSourceName", "50.68.18.229", "country_iso_code,city_name") | ||
fetched rows / total rows = 1/1 | ||
+-------------------------------------------------------------+ | ||
| LookupResult | | ||
|-------------------------------------------------------------| | ||
| {'city_name': 'Vancouver', 'country_iso_code': 'CA'} | | ||
+-------------------------------------------------------------+ | ||
|
||
|
||
Note: | ||
- `dataSourceName` must be an established dataSource on OpenSearch GeoSpatial plugin, detail of configuration can be found: https://opensearch.org/docs/latest/ingest-pipelines/processors/ip2geo/ | ||
- `ip` can be an IPv4 or an IPv6 address | ||
- `options` is a comma separated String for user to specify fields to output, the selection of fields subject to dataSourceProvider's schema, the list of geolite2-city dataset provide fields: "country_iso_code", "country_name", "continent_name", "region_iso_code", "region_name", "city_name", "time_zone", "location" | ||
|
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