Data Type issue from Data Visualizer Import Data in Kibana

Hi Team,

I am trying to import csv file in elasticsearch using Data Visualizer import file for creating index in ES.But I am facing some issues data type issues like some numerical field(values with decimals) in csv coming as string in elasticsearch.
There is no option coming to change datatype during file import.How to keep numerical field as numerical in Elasticsearch.
Please suggest.
Thanks
Sarvendra

you will need to add a custom mapping to set that field explicitly to a numerical data type.

this tutorial shows how: https://www.elastic.co/blog/importing-csv-and-log-data-into-elasticsearch-with-file-data-visualizer

Thanks for the reply @thomasneirynck ..I can change datatype explicitly but records where that field have blank values are not imported in elasticsearch index .
I tried giving long and float both but records with blank values of this fields are not imported in index with given below error.

19: failed to parse field [three_month_average_swipe] of type [float] in document with id 'e5MiDXIB9jlPSD7wYxcX'. Preview of field's value: ' '

70: failed to parse field [three_month_average_swipe] of type [float] in document with id 'rpMiDXIB9jlPSD7wYxcX'. Preview of field's value: ' '

Please suggest.

Sample value of that Field
28717.22
396554.5
496955.88
140875.57
30023.71

Thanks
Sarvendra

I see. I missed calling out you need to set the ingest-pipeline as well.

You can do the conversion explicitly using the "Convert" processor

https://www.elastic.co/guide/en/elasticsearch/reference/current/convert-processor.html

Something like:

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