# Keep relational data nested in one document

**URL:** https://discuss.elastic.co/t/keep-relational-data-nested-in-one-document/71220
**Category:** Logstash
**Created:** [January 11, 2017, 1:26pm UTC](https://discuss.elastic.co/t/keep-relational-data-nested-in-one-document/71220 "2017-01-11T13:26:21Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![JohnG](https://avatars.discourse-cdn.com/v4/letter/j/f4b2a3/32.png) [@JohnG](https://discuss.elastic.co/u/JohnG)
#### Post date: [January 11, 2017, 1:26pm UTC](https://discuss.elastic.co/t/keep-relational-data-nested-in-one-document/71220/1 "2017-01-11T13:26:21Z")

</div>

Hi,

Hope someone can help. I've looked all over Google and this forum without finding the answer.

Lets say I have three tables -

PRODUCT  
Columns - productid, productName _(productId is unique)_

COLOUR  
Columns - colourId, productId, colour _(colourId is unique)_

SIZE  
Columns - sizeId, productId, colourId, size _(sizeId is unique)_

The relationship is 1:M:M

How do I build the configuration within Logstash so I can get the tables into Elasticsearch so the Colour & Size values are nested within the document of Product and keep their own relationships at the same time?

Thanks for any help.

---

<div class="post-metadata">

### Author: ![iti](https://avatars.discourse-cdn.com/v4/letter/i/b19c9b/32.png) [@iti](https://discuss.elastic.co/u/iti)
#### Post date: [January 12, 2017, 6:14pm UTC](https://discuss.elastic.co/t/keep-relational-data-nested-in-one-document/71220/2 "2017-01-12T18:14:04Z")

</div>

check these 2 links. Related problem.

> <https://github.com/logstash-plugins/logstash-filter-aggregate/issues/50>

  

> <https://github.com/logstash-plugins/logstash-filter-aggregate/issues/56>

---

<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 9, 2017, 6:14pm UTC](https://discuss.elastic.co/t/keep-relational-data-nested-in-one-document/71220/3 "2017-02-09T18:14:40Z")

</div>

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