# Convert Elasticsearch output to CSV file using "jq"

**URL:** <https://discuss.elastic.co/t/convert-elasticsearch-output-to-csv-file-using-jq/250587>\
**Category:** Elasticsearch\
**Created:** [October 1, 2020, 3:38am UTC](https://discuss.elastic.co/t/convert-elasticsearch-output-to-csv-file-using-jq/250587 "2020-10-01T03:38:58Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![tusharnemade](https://avatars.discourse-cdn.com/v4/letter/t/67e7ee/32.png) [@tusharnemade](https://discuss.elastic.co/u/tusharnemade)\
**Post date:** [October 1, 2020, 3:38am UTC](https://discuss.elastic.co/t/convert-elasticsearch-output-to-csv-file-using-jq/250587/1 "2020-10-01T03:38:58Z")

</div>

Hi Team

Could you please help me with syntax of jq to be used for getting , entire "\_source" contents of elasticsearch index into single row of csv file.

I am trying out multiple ways but its not working ...

Thanks  
Tushar Nemade

---

<div class="post-metadata">

**Author:** ![tusharnemade](https://avatars.discourse-cdn.com/v4/letter/t/67e7ee/32.png) [@tusharnemade](https://discuss.elastic.co/u/tusharnemade)\
**Post date:** [October 1, 2020, 3:49am UTC](https://discuss.elastic.co/t/convert-elasticsearch-output-to-csv-file-using-jq/250587/2 "2020-10-01T03:49:01Z")

</div>

I meant , multiple doc records in \_source , in each row , one by one in csv format.

---

<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:** [October 29, 2020, 3:49am UTC](https://discuss.elastic.co/t/convert-elasticsearch-output-to-csv-file-using-jq/250587/3 "2020-10-29T03:49:20Z")

</div>

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