# Exporting large set of data from elastic as CSV

**URL:** <https://discuss.elastic.co/t/exporting-large-set-of-data-from-elastic-as-csv/166160>\
**Category:** Elasticsearch\
**Created:** [January 29, 2019, 11:55am UTC](https://discuss.elastic.co/t/exporting-large-set-of-data-from-elastic-as-csv/166160 "2019-01-29T11:55:43Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Divagar\_Tech](https://avatars.discourse-cdn.com/v4/letter/d/9fc29f/32.png) [@Divagar\_Tech](https://discuss.elastic.co/u/Divagar_Tech)\
**Post date:** [January 29, 2019, 11:55am UTC](https://discuss.elastic.co/t/exporting-large-set-of-data-from-elastic-as-csv/166160/1 "2019-01-29T11:55:43Z")

</div>

Hi experts i need to export huge or entire data from particular index of elastic as csv .  
Currently i have explored and using ScrollAPI whats my concern in this we need to loop it to get set of data until we get empty hits.  
For example in query i had set the size to 10000 and consider getting 1 million data for this i need to loop 100 times.  
Is this the way or is there any way than this to get huge or entire data using JAVA Client elastic library??

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [January 29, 2019, 12:13pm UTC](https://discuss.elastic.co/t/exporting-large-set-of-data-from-elastic-as-csv/166160/2 "2019-01-29T12:13:21Z")

</div>

Yes this is the way to extract lot of data.  
It has a big advantage which is that whatever data is added or removed while doing this, it doesn't change what you are going to extract.

---

<div class="post-metadata">

**Author:** ![Divagar\_Tech](https://avatars.discourse-cdn.com/v4/letter/d/9fc29f/32.png) [@Divagar\_Tech](https://discuss.elastic.co/u/Divagar_Tech)\
**Post date:** [January 29, 2019, 12:58pm UTC](https://discuss.elastic.co/t/exporting-large-set-of-data-from-elastic-as-csv/166160/3 "2019-01-29T12:58:02Z")

</div>

Thanks a lot @dadoonet

---

<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:** [February 26, 2019, 12:58pm UTC](https://discuss.elastic.co/t/exporting-large-set-of-data-from-elastic-as-csv/166160/4 "2019-02-26T12:58:09Z")

</div>

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