Hi,
I have just started exploring Elastic and Kibana. When I am trying to upload a .csv file, the type and format isn't recognised properly. It is seen as a string instead of a double. The format of the number of the field is European, e.g. the "," is used for the decimal places; 12,33 for example (instead of 12.33). When I change all the comma's to dots then it is recognised as a double. However, I would assume that I can adjust the settings in the "mappings", and "ingest pipeline" so that I do not have to convert the csv file before uploading and we can use the comma instead of the dot.I cannot find any examples how I can do this.
Hi @mpmass,
I would assume that I can adjust the settings in the "mappings", and "ingest pipeline"
Right!
In mappings, you can change your field from type: "keyword" to type: "double"
and in "ingest pipeline" you can use gsub processor to replace ,
-> .
before processing.
For example, add to processors array:
{
"gsub": {
"field": "your_dobule_field",
"pattern": ",",
"replacement": "."
}
}
Thanks @dosant. For my understanding, this means I am replacing the comma with a dot, effectively the string is transformed to the US format. What if I still want to use the European format. (when building a dashboard it may be confusing when using US notations in a company that is not used to do this) Is that possible?
After you ingest your data as a double
you can adjust the formatting in Kibana:
- Globally: Stack Management -> Advanced settings -> Number format
- Or per field: Stack Management -> Index patterns -> your index pattern -> edit your field and change formatting
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.