# About the "convert" function for CSVs

**URL:** <https://discuss.elastic.co/t/about-the-convert-function-for-csvs/92279>\
**Category:** Logstash\
**Created:** [July 7, 2017, 1:58pm UTC](https://discuss.elastic.co/t/about-the-convert-function-for-csvs/92279 "2017-07-07T13:58:41Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![MartinNouv](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/martinnouv/32/18995_2.png) [@MartinNouv](https://discuss.elastic.co/u/MartinNouv)\
**Post date:** [July 7, 2017, 1:58pm UTC](https://discuss.elastic.co/t/about-the-convert-function-for-csvs/92279/1 "2017-07-07T13:58:41Z")

</div>

Hey there !

I've got some questions about integrate CSVs into elasticsearch with Logstash.

I've got a CSV with some datas like text and numbers (obviously), but also with IPv4 adresses and possibly Localisations (can countries abreviations like EN, DE etc... anc be geo\_points datas ?).

I saw first introduce CSV into elastic is putting all my datas in integer format. Next some documentations, i saw there's a function for CSV which can convert your datas in what you want (the "convert function").

So there's my question : the "convert" function is really only for convert to integer, float, date, date\_time and boolean, Or you can use this one too for convert into ipv4 and geo\_point data ? If no, there's a way to convert those datas next the introduction into elastic ?

Thanks in advance !

---

<div class="post-metadata">

**Author:** ![MartinNouv](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/martinnouv/32/18995_2.png) [@MartinNouv](https://discuss.elastic.co/u/MartinNouv)\
**Post date:** [July 10, 2017, 12:36pm UTC](https://discuss.elastic.co/t/about-the-convert-function-for-csvs/92279/2 "2017-07-10T12:36:35Z")

</div>

anyone ?

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [July 10, 2017, 12:45pm UTC](https://discuss.elastic.co/t/about-the-convert-function-for-csvs/92279/3 "2017-07-10T12:45:45Z")

</div>

geo\_points and IP addresses can not be automatically detected by Elasticsearch, which means that it is not enough to format them in a specific way in Logstash. You will need to define the mapping of these fields in an index template.

---

<div class="post-metadata">

**Author:** ![MartinNouv](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/martinnouv/32/18995_2.png) [@MartinNouv](https://discuss.elastic.co/u/MartinNouv)\
**Post date:** [July 10, 2017, 12:46pm UTC](https://discuss.elastic.co/t/about-the-convert-function-for-csvs/92279/4 "2017-07-10T12:46:52Z")

</div>

Yeah that's what i though...

Thanks !

---

<div class="post-metadata">

**Author:** ![MartinNouv](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/martinnouv/32/18995_2.png) [@MartinNouv](https://discuss.elastic.co/u/MartinNouv)\
**Post date:** [July 12, 2017, 1:22pm UTC](https://discuss.elastic.co/t/about-the-convert-function-for-csvs/92279/5 "2017-07-12T13:22:13Z")

</div>

It's me again.

When I tried to put the convert function (on csv or even on mutate filter), it doesn't work at all, in kibana my number column stays as string. Maybe it comes from my index ?

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [July 12, 2017, 1:24pm UTC](https://discuss.elastic.co/t/about-the-convert-function-for-csvs/92279/6 "2017-07-12T13:24:08Z")

</div>

If the field has already been mapped as a string in the index, the mapping will not change. If you however index into a new index it should be able to correctly identify the mapping.

---

<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:** [August 9, 2017, 1:24pm UTC](https://discuss.elastic.co/t/about-the-convert-function-for-csvs/92279/7 "2017-08-09T13:24:24Z")

</div>

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