Hi, I would like to export data as csv for further analysis outside the elastic stack. When doing this from the Discover page in Kibana, I noticed that all values in the generated csv are formatted as strings, i.e. number-type fields are represented like this:
"12.345","-736","13,123,948"
Is there an option to avoid quotation marks for number-type fields (integer, long, float, etc.)?
It's fine for me to use the corresponding Elasticsearch API directly ("<elasticsearch_url>/api/reporting/generate/csv?jobParams=(...)", if needed.
Best Regards,
Bastian
P.S.: I'm using version 7.3.1 of the elastic stack under the basic license.
The CSV export function will format the data according to what is configured with the Index Pattern. By default, it uses the numeral.js format of 0,0.[000] which causes the export number fields to be wrapped in quotes.
If you edit the number fields under Index Pattern Management and change their numeral.js format to 0, the exported CSV should return numbers without quotes.
Screenshot of what I did locally to change the format:
Works like a charm, thanks a lot! Do you also know of a possibility to automate this, in order to reduce the extra effort when creating fields, or even new index patterns?
For global changes, you should be able to set those under "Advanced Settings". I have attached a screenshot below of the menu option next to "Index Patterns". I believe changing the "Number format" will change the format globally or at least to newly created index patterns.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.