# Import nested documents (csv) into elasticsearch

**URL:** https://discuss.elastic.co/t/import-nested-documents-csv-into-elasticsearch/125937
**Category:** Logstash
**Created:** [March 28, 2018, 12:56pm UTC](https://discuss.elastic.co/t/import-nested-documents-csv-into-elasticsearch/125937 "2018-03-28T12:56:39Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![kevkos236](https://avatars.discourse-cdn.com/v4/letter/k/90ced4/32.png) [@kevkos236](https://discuss.elastic.co/u/kevkos236)
#### Post date: [March 28, 2018, 12:56pm UTC](https://discuss.elastic.co/t/import-nested-documents-csv-into-elasticsearch/125937/1 "2018-03-28T12:56:39Z")

</div>

Hi,

we are currently looking for a proper way to import some data into elasticsearch. The data is basically a relational datamodel split into several csv files.

For example we have a csv `customer` with multiple columns and a unique ID for each row. Then we have another csv `constracts` where a contract belongs to 1 customer. We now thought of importing all contracts as nested documents for the customer that matches with the foreign key customerId in `contracts`.

Is it possible to do something like this in logstash? So basically I need to output each document as a nested document to the parent document with a specific ID.

---

<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: [April 25, 2018, 12:56pm UTC](https://discuss.elastic.co/t/import-nested-documents-csv-into-elasticsearch/125937/2 "2018-04-25T12:56:53Z")

</div>

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