# Create new document from extracted fields

**URL:** <https://discuss.elastic.co/t/create-new-document-from-extracted-fields/206517>\
**Category:** Elasticsearch\
**Created:** [November 5, 2019, 5:14am UTC](https://discuss.elastic.co/t/create-new-document-from-extracted-fields/206517 "2019-11-05T05:14:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![earthpatipon](https://avatars.discourse-cdn.com/v4/letter/e/df788c/32.png) [@earthpatipon](https://discuss.elastic.co/u/earthpatipon)\
**Post date:** [November 5, 2019, 5:14am UTC](https://discuss.elastic.co/t/create-new-document-from-extracted-fields/206517/1 "2019-11-05T05:14:41Z")

</div>

Hi there,

Here is my log structure that comes directly from a service.

```
PUT my_index/_doc/1
{
    "user": [
    {
      "firstName": "Tim",
      "lastName": "Cook"
    },
    {
      "firstName": "Bill",
      "lastName": "Gates"
    }
    ]
}

```

I want to extract each index in user array and create new documents for them.  
So it would be something like,

```
PUT my_index/_doc/1
{
  "user": {
      "firstName": "Tim",
      "lastName": "Cook"
    }
}

PUT my_index/_doc/2
{
  "user": {
      "firstName": "Bill",
      "lastName": "Gates"
    }
}

```

My question is how to do so? use ingest pipeline node? Please give me some idea

---

<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:** [November 5, 2019, 5:25am UTC](https://discuss.elastic.co/t/create-new-document-from-extracted-fields/206517/2 "2019-11-05T05:25:28Z")

</div>

As far as I know ingest pipelines can not generate additional documents, so you may need to use a split filter in Logstash.

---

<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:** [December 3, 2019, 5:25am UTC](https://discuss.elastic.co/t/create-new-document-from-extracted-fields/206517/3 "2019-12-03T05:25:32Z")

</div>

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