# Insert multiple jdbc rows into the same ES document under nested field

**URL:** <https://discuss.elastic.co/t/insert-multiple-jdbc-rows-into-the-same-es-document-under-nested-field/234486>\
**Category:** Logstash\
**Created:** [May 27, 2020, 8:21am UTC](https://discuss.elastic.co/t/insert-multiple-jdbc-rows-into-the-same-es-document-under-nested-field/234486 "2020-05-27T08:21:32Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Xophis](https://avatars.discourse-cdn.com/v4/letter/x/65b543/32.png) [@Xophis](https://discuss.elastic.co/u/Xophis)\
**Post date:** [May 27, 2020, 8:21am UTC](https://discuss.elastic.co/t/insert-multiple-jdbc-rows-into-the-same-es-document-under-nested-field/234486/1 "2020-05-27T08:21:33Z")

</div>

Hi,

I would like to insert in the same elasticsearch document, all jdbc rows with the same ID into a nested field called "logs".  
Can someone explain me how to convert jdbc input rows of logs into the following JSON structure :

`{ "id";"4dca1978-a591-4a6e-a431-1e9b0ee7a2e1", "logs":[{ "jdbcColumn1":"value1", "jdbcColumn2":"value2", "jdbcColumn3":"value3" },{ "jdbcColumn1":"value1", "jdbcColumn2":"value2", "jdbcColumn3":"value3" }] }`

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:** [June 24, 2020, 8:21am UTC](https://discuss.elastic.co/t/insert-multiple-jdbc-rows-into-the-same-es-document-under-nested-field/234486/2 "2020-06-24T08:21:33Z")

</div>

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