# Is there a way to dynamically group overlapping events?

**URL:** <https://forum.opensearch.org/t/is-there-a-way-to-dynamically-group-overlapping-events/14894>\
**Category:** OpenSearch\
**Created:** [June 30, 2023, 8:18am UTC](https://forum.opensearch.org/t/is-there-a-way-to-dynamically-group-overlapping-events/14894 "2023-06-30T08:18:05Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![lan](https://avatars.discourse-cdn.com/v4/letter/l/df788c/32.png) [@lan](https://forum.opensearch.org/u/lan)\
**Post date:** [June 30, 2023, 8:18am UTC](https://forum.opensearch.org/t/is-there-a-way-to-dynamically-group-overlapping-events/14894/1 "2023-06-30T08:18:05Z")

</div>

**Versions** (relevant - OpenSearch/Dashboard/Server OS/Browser):  
latest docker

**Describe the issue** :  
I am importing data from MySQL using logstash, that contains events with a start and an end date. However, some of these events overlap and, in some conditions, need to be treated as a single event, starting at the start of the earliest overlapping event and ending at the end of the latest overlapping event.

Is there a way to do this (maybe in a separate index, or by tagging the events with a new id that I could then use in scripted fields or simple visualizations) through logstash or opensearch ? I’m thinking scripted fields (that I would then move to logstash) maybe ?

Thanks in advance for all the help you could give, even if you think it’s not exactly what I’m looking for.
