# Reprocess documents

**URL:** <https://discuss.elastic.co/t/reprocess-documents/150256>\
**Category:** Elasticsearch\
**Created:** [September 27, 2018, 8:55pm UTC](https://discuss.elastic.co/t/reprocess-documents/150256 "2018-09-27T20:55:06Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Zachary\_Buckholz](https://avatars.discourse-cdn.com/v4/letter/z/f1d935/32.png) [@Zachary\_Buckholz](https://discuss.elastic.co/u/Zachary_Buckholz)\
**Post date:** [September 27, 2018, 8:55pm UTC](https://discuss.elastic.co/t/reprocess-documents/150256/1 "2018-09-27T20:55:07Z")

</div>

I have documents that currently exist with a single \_message field containing raw json. I'd like to reprocess all these documents and run them through a json parser to update the document and add fields / values.

What's the best approach for this?  
External script to query, find a record needing updates, update it, then push it back to es as an update, or some other way?

Thanks  
Zach

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [September 28, 2018, 7:33am UTC](https://discuss.elastic.co/t/reprocess-documents/150256/2 "2018-09-28T07:33:03Z")

</div>

You may want to look into using the [reindex API](https://www.elastic.co/guide/en/elasticsearch/reference/6.4/docs-reindex.html) together with an [ingest node pipeline](https://www.elastic.co/guide/en/elasticsearch/reference/6.4/ingest.html). This should work as long as all data is present within each document. If you want to parse and enrich it based on external data, you may need a different approach, e.g. Logstash.

---

<div class="post-metadata">

**Author:** ![Zachary\_Buckholz](https://avatars.discourse-cdn.com/v4/letter/z/f1d935/32.png) [@Zachary\_Buckholz](https://discuss.elastic.co/u/Zachary_Buckholz)\
**Post date:** [September 28, 2018, 1:04pm UTC](https://discuss.elastic.co/t/reprocess-documents/150256/3 "2018-09-28T13:04:07Z")

</div>

That seems like a great idea, thank you for pointing it out.

---

<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 26, 2018, 1:04pm UTC](https://discuss.elastic.co/t/reprocess-documents/150256/4 "2018-10-26T13:04:17Z")

</div>

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