# DSL aggregation query in event pair documents for showing in kibana

**URL:** <https://discuss.elastic.co/t/dsl-aggregation-query-in-event-pair-documents-for-showing-in-kibana/277165>\
**Category:** Elasticsearch\
**Created:** [June 27, 2021, 10:03pm UTC](https://discuss.elastic.co/t/dsl-aggregation-query-in-event-pair-documents-for-showing-in-kibana/277165 "2021-06-27T22:03:29Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![irajtaghlidi](https://avatars.discourse-cdn.com/v4/letter/i/dfb087/32.png) [@irajtaghlidi](https://discuss.elastic.co/u/irajtaghlidi)\
**Post date:** [June 27, 2021, 10:03pm UTC](https://discuss.elastic.co/t/dsl-aggregation-query-in-event-pair-documents-for-showing-in-kibana/277165/1 "2021-06-27T22:03:30Z")

</div>

I have event document pairs that each one shows the start or end of an event. Every two events have a key with the save value.  
for example:  
doc1:  
{  
startTime: 123  
endTime: 0  
buildId: ABC1 (shared ID)  
}

doc2:  
{  
startTime: 0  
endTime: 124  
buildId: ABC1 (shared ID)  
}

I want to create a chart in Kibana to show processing of events, something like this:  
. . . .\_\_\_\_ . . . . . . \_\_\_\_\_\_\_\_\_\_  
. . . |. . .| . . . . . | . . . . . . .|  
\_\_\_ |. . .|\_\_\_\_\_\_ | . . . . . . .|\_\_\_\_\_\_\_\_\_\_\_\_

Note: It's possible for two separate events (document pair) to occur in a shared time frame. So I DONT need separation in the graph and shows the processing times are enough for me.

I appreciate tips to find a solution for this requrement.

Thanks guys.

---

<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:** [July 25, 2021, 10:03pm UTC](https://discuss.elastic.co/t/dsl-aggregation-query-in-event-pair-documents-for-showing-in-kibana/277165/2 "2021-07-25T22:03:40Z")

</div>

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