Skip to content

CSV result

Eliran Moyal edited this page Dec 30, 2015 · 2 revisions

CSV result - Rest API

** warning! this is an experimental feature . that means that not all cases tested **

how to use?

When using the REST api you use something like:
http://xxxx:9200/_sql?sql=select field from index
And than you get the result as elasticsearch return the result

Now you can get them as a csv for lighter parsing
Just add the parameter
http://xxxx:9200/_sql?format=csv&sql=select field from index
More parameters you can add:

  • flat for nested objects. (just like on site)
    http://xxxx:9200/_sql?flat=true&format=csv&sql=select field from index
  • change separator (default is ",")
    http://xxxx:9200/_sql?separator=;&format=csv&sql=select field from index
  • change newLine (default is "\n")
    http://xxxx:9200/_sql?newLine=b&format=csv&sql=select field from index
Clone this wiki locally