# How to convert string to geoip datatype while ingesting data from logstash to elastic search

**URL:** <https://discuss.elastic.co/t/how-to-convert-string-to-geoip-datatype-while-ingesting-data-from-logstash-to-elastic-search/179095>\
**Category:** Logstash\
**Created:** [April 30, 2019, 1:59pm UTC](https://discuss.elastic.co/t/how-to-convert-string-to-geoip-datatype-while-ingesting-data-from-logstash-to-elastic-search/179095 "2019-04-30T13:59:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Swati123](https://avatars.discourse-cdn.com/v4/letter/s/46a35a/32.png) [@Swati123](https://discuss.elastic.co/u/Swati123)\
**Post date:** [April 30, 2019, 1:59pm UTC](https://discuss.elastic.co/t/how-to-convert-string-to-geoip-datatype-while-ingesting-data-from-logstash-to-elastic-search/179095/1 "2019-04-30T13:59:31Z")

</div>

Hi all,

I have a log field by default as string src\_ip = 10.14.114.18 I am able to have it as ip datatype in kibana by running default mappings API.

But for visualization, I need this as geoip datatype so that it can be used in coordinate or region maps

I am ingesting data from logstash to elastic-search.

Can anyone help me on this to get src\_ip field as geoip.i had also tried geoip processor as -  
geoip {  
source =\> "source\_ip"  
}  
but it doesn't worked out this still as string datatype in kibana.

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [April 30, 2019, 3:01pm UTC](https://discuss.elastic.co/t/how-to-convert-string-to-geoip-datatype-while-ingesting-data-from-logstash-to-elastic-search/179095/2 "2019-04-30T15:01:26Z")

</div>

```
geoip { source => "source_ip" }

```

will write geo information into the field geoip. If you change that to overwrite source\_ip using the target option you will have to add a template to your index.

---

<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 28, 2019, 3:01pm UTC](https://discuss.elastic.co/t/how-to-convert-string-to-geoip-datatype-while-ingesting-data-from-logstash-to-elastic-search/179095/3 "2019-05-28T15:01:42Z")

</div>

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