# How to aggregate database field in nested array as below json format?

**URL:** <https://discuss.elastic.co/t/how-to-aggregate-database-field-in-nested-array-as-below-json-format/208835>\
**Category:** Logstash\
**Created:** [November 21, 2019, 8:57am UTC](https://discuss.elastic.co/t/how-to-aggregate-database-field-in-nested-array-as-below-json-format/208835 "2019-11-21T08:57:58Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![indra](https://avatars.discourse-cdn.com/v4/letter/i/5f9b8f/32.png) [@indra](https://discuss.elastic.co/u/indra)\
**Post date:** [November 21, 2019, 8:57am UTC](https://discuss.elastic.co/t/how-to-aggregate-database-field-in-nested-array-as-below-json-format/208835/1 "2019-11-21T08:57:59Z")

</div>

"\_index" : "product",  
"\_type" : "product",  
"\_id" : "191201",  
"\_score" : 1.0,  
"\_source" : {  
"styleno" : "191201",  
"@version" : "1",  
"@timestamp" : "2019-11-20T15:28:07.322Z",  
"colors" : "01"  
[ {  
"sizeno" : "0240",  
"ean" : "4059506390524",  
"sizecode" : "10"  
},  
{  
"sizeno" : "0230",  
"ean" : "4059506391347",  
"colors" : "04",  
"sizecode" : "9.5"  
}],  
"colors" : "02"  
[ {  
"sizeno" : "0240",  
"ean" : "4059506390524",  
"sizecode" : "10"  
},  
{  
"sizeno" : "0230",  
"ean" : "4059506391347",  
"sizecode" : "9.5"  
}]}

---

<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 19, 2019, 8:58am UTC](https://discuss.elastic.co/t/how-to-aggregate-database-field-in-nested-array-as-below-json-format/208835/2 "2019-12-19T08:58:07Z")

</div>

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