# Combining (grouping) two records as one in Kibana Discover

**URL:** <https://discuss.elastic.co/t/combining-grouping-two-records-as-one-in-kibana-discover/266937>\
**Category:** Kibana\
**Created:** [March 11, 2021, 12:08pm UTC](https://discuss.elastic.co/t/combining-grouping-two-records-as-one-in-kibana-discover/266937 "2021-03-11T12:08:53Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![usman1](https://avatars.discourse-cdn.com/v4/letter/u/c67d28/32.png) [@usman1](https://discuss.elastic.co/u/usman1)\
**Post date:** [March 11, 2021, 12:08pm UTC](https://discuss.elastic.co/t/combining-grouping-two-records-as-one-in-kibana-discover/266937/1 "2021-03-11T12:08:53Z")

</div>

Hi,

I want to group (aggregate) records on the basis of a specific ID. At the moment, my data has an event START and END record identified by the IDs. START and END record have different fields in them which I want to combine in one row.  
The current mapping is similar to the attached image:

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/9/4/94a8a25d88226909841a0b14276e8417a6999308.png)

Here, Batch\_ID is the field which I want to use for combining. I want to combine the fields from both START and END records in such a way that one row has important fields from both records.

Thanks.

---

<div class="post-metadata">

**Author:** ![Felix\_Roessel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/felix_roessel/32/41623_2.png) [@Felix\_Roessel](https://discuss.elastic.co/u/Felix_Roessel)\
**Post date:** [March 13, 2021, 5:45pm UTC](https://discuss.elastic.co/t/combining-grouping-two-records-as-one-in-kibana-discover/266937/2 "2021-03-13T17:45:57Z")

</div>

This type of aggregation can not be done in Discover. However you can use the data table vis to achieve that.

Best option is to join those events during index or by using transforms.

---

<div class="post-metadata">

**Author:** ![usman1](https://avatars.discourse-cdn.com/v4/letter/u/c67d28/32.png) [@usman1](https://discuss.elastic.co/u/usman1)\
**Post date:** [March 15, 2021, 12:13pm UTC](https://discuss.elastic.co/t/combining-grouping-two-records-as-one-in-kibana-discover/266937/3 "2021-03-15T12:13:00Z")

</div>

Thank you for the response @Felix_Roessel.

Joining events while indexing might not be possible as the duration of time between both these events can be in hours. Regarding the use of table vis or transforms, any useful link will be highly appreciated. Though, I will explore these options on my own as well.

---

<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 12, 2021, 12:13pm UTC](https://discuss.elastic.co/t/combining-grouping-two-records-as-one-in-kibana-discover/266937/4 "2021-04-12T12:13:03Z")

</div>

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