# Pipeline processor to convert nested array to documents while reindexing

**URL:** <https://discuss.elastic.co/t/pipeline-processor-to-convert-nested-array-to-documents-while-reindexing/261547>\
**Category:** Elasticsearch\
**Created:** [January 19, 2021, 1:21pm UTC](https://discuss.elastic.co/t/pipeline-processor-to-convert-nested-array-to-documents-while-reindexing/261547 "2021-01-19T13:21:29Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![darshan\_ambre](https://avatars.discourse-cdn.com/v4/letter/d/85f322/32.png) [@darshan\_ambre](https://discuss.elastic.co/u/darshan_ambre)\
**Post date:** [January 19, 2021, 1:21pm UTC](https://discuss.elastic.co/t/pipeline-processor-to-convert-nested-array-to-documents-while-reindexing/261547/1 "2021-01-19T13:21:30Z")

</div>

Hi Team,

Need a solution to take data from source index and have an ingest pipeline to extract data from array in each document of source index as individual document to destination index.

e.g.

main index data:

```auto
    {
        "docId" : 1,
        "lineItems" : [
             {
                "lineId" : "line_1",
                "name" : "line one"
             },
             {
                "lineId" : "line_2",
                "name" : "line two"
             }
         ]
}

```

Required Data in Destination Index:

```auto
[
    {
       "docId" : 1,
       "lineId" : "line_1",
       "name" : "line one
    },
    {

       "docId" : 1,
       "lineId" : "line_2",
       "name" : "line two
     }
]

```

Please suggest a way to implement this..

Thanks!!

---

<div class="post-metadata">

**Author:** ![darshan\_ambre](https://avatars.discourse-cdn.com/v4/letter/d/85f322/32.png) [@darshan\_ambre](https://discuss.elastic.co/u/darshan_ambre)\
**Post date:** [January 19, 2021, 2:28pm UTC](https://discuss.elastic.co/t/pipeline-processor-to-convert-nested-array-to-documents-while-reindexing/261547/2 "2021-01-19T14:28:43Z")

</div>

@dadoonet Please help!

---

<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 19, 2021, 3:09pm UTC](https://discuss.elastic.co/t/pipeline-processor-to-convert-nested-array-to-documents-while-reindexing/261547/3 "2021-01-19T15:09:17Z")

</div>

Please be patient in waiting for responses to your question and refrain from pinging multiple times asking for a response or opening multiple topics for the same question. This is a community forum, it may take time for someone to reply to your question. For more information please refer to the [Community Code of Conduct](https://www.elastic.co/community/codeofconduct) specifically the section "Be patient". Also, please refrain from pinging folks directly, this is a forum and anyone that participates might be able to assist you.

If you are in need of a service with an SLA that covers response times for questions then you may want to consider talking to us about a [subscription](https://www.elastic.co/subscriptions).

It's fine to answer on your own thread after 2 or 3 days (not including weekends) if you don't have an answer.

---

<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 19, 2021, 3:10pm UTC](https://discuss.elastic.co/t/pipeline-processor-to-convert-nested-array-to-documents-while-reindexing/261547/4 "2021-01-19T15:10:25Z")

</div>

I don't think you can generate 2 documents from a single one

---

<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:** [January 19, 2021, 3:12pm UTC](https://discuss.elastic.co/t/pipeline-processor-to-convert-nested-array-to-documents-while-reindexing/261547/5 "2021-01-19T15:12:10Z")

</div>

Logstash has a split filter that can do this but as far as I know this in not possible in ingest pipelines.

---

<div class="post-metadata">

**Author:** ![darshan\_ambre](https://avatars.discourse-cdn.com/v4/letter/d/85f322/32.png) [@darshan\_ambre](https://discuss.elastic.co/u/darshan_ambre)\
**Post date:** [January 20, 2021, 8:17am UTC](https://discuss.elastic.co/t/pipeline-processor-to-convert-nested-array-to-documents-while-reindexing/261547/6 "2021-01-20T08:17:33Z")

</div>

Thanks @dadoonet and sorry for that, will make sure from now on.  
Yes @Christian_Dahlqvist using the same split filter to perform this activity. Thank you!

---

<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 17, 2021, 8:17am UTC](https://discuss.elastic.co/t/pipeline-processor-to-convert-nested-array-to-documents-while-reindexing/261547/7 "2021-02-17T08:17:34Z")

</div>

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