# Find the gelocation from ip internal network

**URL:** <https://discuss.elastic.co/t/find-the-gelocation-from-ip-internal-network/270559>\
**Category:** Kibana\
**Created:** [April 19, 2021, 9:33am UTC](https://discuss.elastic.co/t/find-the-gelocation-from-ip-internal-network/270559 "2021-04-19T09:33:13Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vannessa\_Kemeni](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vannessa_kemeni/32/83669_2.png) [@Vannessa\_Kemeni](https://discuss.elastic.co/u/Vannessa_Kemeni)\
**Post date:** [April 19, 2021, 9:33am UTC](https://discuss.elastic.co/t/find-the-gelocation-from-ip-internal-network/270559/1 "2021-04-19T09:33:13Z")

</div>

Hello,  
i have internal ip adress and the corresonding geolocation. How i can create a list with those ip adresses and the location and enrich my documents in elastic search.  
Thank you.

---

<div class="post-metadata">

**Author:** ![flash1293](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/flash1293/32/41227_2.png) [@flash1293](https://discuss.elastic.co/u/flash1293)\
**Post date:** [April 19, 2021, 3:18pm UTC](https://discuss.elastic.co/t/find-the-gelocation-from-ip-internal-network/270559/2 "2021-04-19T15:18:39Z")

</div>

You can do this using the enrich processor in Elasticsearch: [Introducing the enrich processor for Elasticsearch ingest nodes | Elastic Blog](https://www.elastic.co/blog/introducing-the-enrich-processor-for-elasticsearch-ingest-nodes)

For existing data you would need to reindex it through the your enrichment pipeline.

---

<div class="post-metadata">

**Author:** ![Vannessa\_Kemeni](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vannessa_kemeni/32/83669_2.png) [@Vannessa\_Kemeni](https://discuss.elastic.co/u/Vannessa_Kemeni)\
**Post date:** [April 28, 2021, 7:42pm UTC](https://discuss.elastic.co/t/find-the-gelocation-from-ip-internal-network/270559/3 "2021-04-28T19:42:49Z")

</div>

I don't really understand how to that. For now, i have the following ingest file, that provides me th geolocation from IP adress:  
{  
"description": "Wazuh alerts pipeline",  
"processors": [  
{ "json" : { "field" : "message", "add\_to\_root": true } },  
{  
"geoip": {  
"field": "data.srcip",  
"target\_field": "GeoLocation",  
"properties": ["city\_name", "country\_name", "region\_name", "location"],  
"ignore\_missing": true,  
"ignore\_failure": true  
}  
},  
{  
"geoip": {  
"field": "data.win.eventdata.ipAddress",  
"target\_field": "GeoLocation",  
"properties": ["city\_name", "country\_name", "region\_name", "location"],  
"ignore\_missing": true,  
"ignore\_failure": true  
}  
},  
{  
"geoip": {  
"field": "data.aws.sourceIPAddress",  
"target\_field": "GeoLocation",  
"properties": ["city\_name", "country\_name", "region\_name", "location"],  
"ignore\_missing": true,  
"ignore\_failure": true  
}  
},  
{  
"geoip": {  
"field": "data.gcp.jsonPayload.sourceIP",  
"target\_field": "GeoLocation",  
"properties": ["city\_name", "country\_name", "region\_name", "location"],  
"ignore\_missing": true,  
"ignore\_failure": true  
}  
},  
{  
"date": {  
"field": "timestamp",  
"target\_field": "@timestamp",  
"formats": ["ISO8601"],  
"ignore\_failure": false  
}  
},  
{  
"date\_index\_name": {  
"field": "timestamp",  
"date\_rounding": "d",  
"index\_name\_prefix": "{{fields.index\_prefix}}",  
"index\_name\_format": "yyyy.MM.dd",  
"ignore\_failure": false  
}  
},  
{ "remove": { "field": "message", "ignore\_missing": true, "ignore\_failure": true } },  
{ "remove": { "field": "ecs", "ignore\_missing": true, "ignore\_failure": true } },  
{ "remove": { "field": "beat", "ignore\_missing": true, "ignore\_failure": true } },  
{ "remove": { "field": "input\_type", "ignore\_missing": true, "ignore\_failure": true } },  
{ "remove": { "field": "tags", "ignore\_missing": true, "ignore\_failure": true } },  
{ "remove": { "field": "count", "ignore\_missing": true, "ignore\_failure": true } },  
{ "remove": { "field": "@version", "ignore\_missing": true, "ignore\_failure": true } },  
{ "remove": { "field": "log", "ignore\_missing": true, "ignore\_failure": true } },  
{ "remove": { "field": "offset", "ignore\_missing": true, "ignore\_failure": true } },  
{ "remove": { "field": "type", "ignore\_missing": true, "ignore\_failure": true } },  
{ "remove": { "field": "host", "ignore\_missing": true, "ignore\_failure": true } },  
{ "remove": { "field": "fields", "ignore\_missing": true, "ignore\_failure": true } },  
{ "remove": { "field": "event", "ignore\_missing": true, "ignore\_failure": true } },  
{ "remove": { "field": "fileset", "ignore\_missing": true, "ignore\_failure": true } },  
{ "remove": { "field": "service", "ignore\_missing": true, "ignore\_failure": true } }  
],  
"on\_failure" : [{  
"drop" : { }  
}]  
}.  
So now, i want to configure for some ip address the geolocation. I found this:  
if [win.eventdata.ipAddress] =~ /^139.80./ or [win.eventdata.ipAddress] =~ /^10./ {  
mutate { replace =\> { "[geoip][timezone]" =\> "" } }  
mutate { replace =\> { "[geoip][country\_name]" =\> "" } }  
.  
. For example i have this network 192.168.0.1/24 and the ip Adresses are from 192.168.0.0 up to 192.168.0.255 and belongs to italia. How i can configure the if condition. I don't understanr the syntax.  
Thanks

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [May 26, 2021, 7:43pm UTC](https://discuss.elastic.co/t/find-the-gelocation-from-ip-internal-network/270559/4 "2021-05-26T19:43:11Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
