# Fetch multiples traces with a common id

**URL:** https://discuss.elastic.co/t/fetch-multiples-traces-with-a-common-id/348202
**Category:** Elasticsearch
**Created:** [November 29, 2023, 8:34am UTC](https://discuss.elastic.co/t/fetch-multiples-traces-with-a-common-id/348202 "2023-11-29T08:34:57Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![casteillet](https://avatars.discourse-cdn.com/v4/letter/c/ce73a5/32.png) [@casteillet](https://discuss.elastic.co/u/casteillet)
#### Post date: [November 29, 2023, 8:34am UTC](https://discuss.elastic.co/t/fetch-multiples-traces-with-a-common-id/348202/1 "2023-11-29T08:34:57Z")

</div>

Hi,

I'm new with the Elasticsearch web interface. I'm trying to display player session results on the dashboard. I have three dropdown filters, with difficulty, level selected and name of the player (actor).  
During a single session I'm sending multiple traces, for examples when the game initialize, when the player succeed a mini game, when the game end. All of theses traces share a session id.  
My goal is if I send 10 traces for one session, I do 3 sessions, and in the database there is a total of 30 traces which mean there is 3 sessions, elastic understand that he need to fetch results in the 3 data group where the data inside of them are linked together with the session id, which would lead to show result on the dashboard without indicating the session id manually in the filters.

I really hope someone could help me, the struggle is real. Thank you

---

<div class="post-metadata">

### Author: ![ashishtiwari1993](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ashishtiwari1993/32/135241_2.png) [@ashishtiwari1993](https://discuss.elastic.co/u/ashishtiwari1993)
#### Post date: [November 29, 2023, 3:15pm UTC](https://discuss.elastic.co/t/fetch-multiples-traces-with-a-common-id/348202/2 "2023-11-29T15:15:58Z")

</div>

Hi @casteillet, Welcome to the Elastic community.

Need more information on your Query.

But as far I understand, You need to fetch result in group which should group by Session ID which can be achievable using [Top hits aggregation](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-metrics-top-hits-aggregation.html).

---

<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 27, 2023, 3:16pm UTC](https://discuss.elastic.co/t/fetch-multiples-traces-with-a-common-id/348202/3 "2023-12-27T15:16:42Z")

</div>

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