# Index to file (.json)

**URL:** <https://discuss.elastic.co/t/index-to-file-json/324683>\
**Category:** Elasticsearch\
**Created:** [February 3, 2023, 5:43pm UTC](https://discuss.elastic.co/t/index-to-file-json/324683 "2023-02-03T17:43:03Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![tmslara.a](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tmslara.a/32/116339_2.png) [@tmslara.a](https://discuss.elastic.co/u/tmslara.a)\
**Post date:** [February 3, 2023, 5:43pm UTC](https://discuss.elastic.co/t/index-to-file-json/324683/1 "2023-02-03T17:43:03Z")

</div>

Hi,

I have a running Elastic node with an index. I'm constantly inserting documents into the index in a process that I can't stop. I need to 'export' the index to a file (e.g., a .json). I've check alternatives to do this considering snapshots or Elasticdump. However, I cannot use either of them because I don't have the snapshot.repo configured in the elasticsearch.yml (in order to create a snapshot) and I can't install Elasticdump.

Is there any native alternative to export an index into a .json file?

Best regards.

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [February 5, 2023, 10:19pm UTC](https://discuss.elastic.co/t/index-to-file-json/324683/2 "2023-02-05T22:19:15Z")

</div>

The closest one would be Logstash with the Elasticsearch input and a file output.

---

<div class="post-metadata">

**Author:** ![tmslara.a](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tmslara.a/32/116339_2.png) [@tmslara.a](https://discuss.elastic.co/u/tmslara.a)\
**Post date:** [February 9, 2023, 2:50pm UTC](https://discuss.elastic.co/t/index-to-file-json/324683/3 "2023-02-09T14:50:53Z")

</div>

Just in case that this could be helpful for anyone. I managed to get the mapping and data of an index using the Elasticsearch Python API ([docs](https://elasticsearch-py.readthedocs.io/en/v7.17.9/#)). The scan helper described in the documentation is useful when obtaining the data.

For my use case then I upload the json files into an index using Elasticdump.

---

<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:** [March 9, 2023, 2:51pm UTC](https://discuss.elastic.co/t/index-to-file-json/324683/4 "2023-03-09T14:51:35Z")

</div>

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