# Logstash aggregate - JDBC SQL Relations

**URL:** <https://discuss.elastic.co/t/logstash-aggregate-jdbc-sql-relations/214424>\
**Category:** Logstash\
**Created:** [January 9, 2020, 12:02pm UTC](https://discuss.elastic.co/t/logstash-aggregate-jdbc-sql-relations/214424 "2020-01-09T12:02:36Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ahmed\_Ahmed](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ahmed_ahmed/32/44720_2.png) [@Ahmed\_Ahmed](https://discuss.elastic.co/u/Ahmed_Ahmed)\
**Post date:** [January 9, 2020, 12:02pm UTC](https://discuss.elastic.co/t/logstash-aggregate-jdbc-sql-relations/214424/1 "2020-01-09T12:02:36Z")

</div>

Hi,  
I have been following your responses and found them always helpful and spot on. I would like to ask With reference to the following where there is a parent-child relation is pipelined  
[Logstash aggregate-example4](https://www.elastic.co/guide/en/logstash/current/plugins-filters-aggregate.html#plugins-filters-aggregate-example4)  
I wonder how to achieve a scenario where event elements have a hierarchal relationship like following

{ "country\_name": "France", "town\_name": "Paris" , "location-name": "Location A in Paris"}  
{ "country\_name": "France", "town\_name": "Paris" , "location-name": "Location B in Paris"}  
{ "country\_name": "France", "town\_name": "Paris" , "location-name": "Location C in Paris"}  
{ "country\_name": "France", "town\_name": "Paris" , "location-name": "Location D in Paris"}

{ "country\_name": "France", "town\_name": "Marseille", "location-name": "Location A in Marseille" }  
{ "country\_name": "France", "town\_name": "Marseille", "location-name": "Location B in Marseille" }  
{ "country\_name": "France", "town\_name": "Marseille", "location-name": "Location C in Marseille" }  
{ "country\_name": "France", "town\_name": "Marseille", "location-name": "Location D in Marseille" }  
{ "country\_name": "France", "town\_name": "Marseille", "location-name": "Location E in Marseille" }  
{ "country\_name": "France", "town\_name": "Marseille", "location-name": "Location F in Marseille" }  
{ "country\_name": "France", "town\_name": "Marseille", "location-name": "Location G in Marseille" }

{ "country\_name": "USA", "town\_name": "New-York" , "location-name": "Location A in New-York"}  
{ "country\_name": "USA", "town\_name": "New-York" , "location-name": "Location B in New-York"}  
{ "country\_name": "USA", "town\_name": "New-York" , "location-name": "Location C in New-York"}  
{ "country\_name": "USA", "town\_name": "New-York" , "location-name": "Location D in New-York"}  
parent (n)  
---child (n)  
------ grand-child (n)  
------------great-grand-child (n)  
I hope I could ask it right. I am totally new to this and your help in this regard is highly appreciated.  
Regards.

---

<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 6, 2020, 12:02pm UTC](https://discuss.elastic.co/t/logstash-aggregate-jdbc-sql-relations/214424/2 "2020-02-06T12:02:38Z")

</div>

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