Uses the ip2region lib to add Chinese region info based on provided ip address
- download .zip file
- use Elasticsearch elasticsearch-plugin command to install locally [reference]
PUT _ingest/pipeline/custom-pipeline-name
{
"description": "custom description",
"processors": [
{
"regionip": {
"field": "field_containing_ip_address",
"target_field": "target_field_name",
"properties": ["country_name", "region_name", "city_name"]
}
}
]
}
target_field result example
"regionip": {
"country_name": "中国",
"city_name": "上海市",
"region_name": "上海"
}
for more usage please refer to official doc
conf | required | note |
---|---|---|
field | yes | Field name containing ip address |
target_field | no | Field name to write region info to, defaults to regionip |
ignore_missing | no | If set to true, doc missing specified field will not throw a exception, defaults to false . |
ip2region_algorithm | no | BTREE /BINARY /MEMORY , defaults to MEMORY [link] |
properties | no | ip , country_name , region_name , city_name , isp_name , defaults to all properties |
gradle clean assemble