# Indices to JSON

**URL:** <https://discuss.elastic.co/t/indices-to-json/270459>\
**Category:** Elasticsearch\
**Created:** [April 17, 2021, 7:12pm UTC](https://discuss.elastic.co/t/indices-to-json/270459 "2021-04-17T19:12:52Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Cosmin\_Ciobanu1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cosmin_ciobanu1/32/78785_2.png) [@Cosmin\_Ciobanu1](https://discuss.elastic.co/u/Cosmin_Ciobanu1)\
**Post date:** [April 17, 2021, 7:12pm UTC](https://discuss.elastic.co/t/indices-to-json/270459/1 "2021-04-17T19:12:52Z")

</div>

Hi!

I want to export a indices to a JSON file. I've verified this location `/var/lib/elasticsearch/nodes/0/indices/RKq99IGSSF6aLa_3J29XLg`, but there is no JSON file and I don't know which one is the correct file.

Thank you!

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [April 18, 2021, 2:47am UTC](https://discuss.elastic.co/t/indices-to-json/270459/2 "2021-04-18T02:47:44Z")

</div>

The data in the elastic data directories is in the lucene segments format it is not json format you will not be able to just copy json out of one of those files.

You will need to export the data using the elasticsearch rest API or a tool like logstash which can read it and write it to a file.

Which method you choose kind of depends on how big the index is and how fast you need to get it done

---

<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:** [May 16, 2021, 2:48am UTC](https://discuss.elastic.co/t/indices-to-json/270459/3 "2021-05-16T02:48:26Z")

</div>

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