# Is there a way to dynamically group overlapping events?

**URL:** <https://discuss.elastic.co/t/is-there-a-way-to-dynamically-group-overlapping-events/337290>\
**Category:** Logstash\
**Created:** [June 30, 2023, 9:03am UTC](https://discuss.elastic.co/t/is-there-a-way-to-dynamically-group-overlapping-events/337290 "2023-06-30T09:03:29Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![landre](https://avatars.discourse-cdn.com/v4/letter/l/bcef8e/32.png) [@landre](https://discuss.elastic.co/u/landre)\
**Post date:** [June 30, 2023, 9:03am UTC](https://discuss.elastic.co/t/is-there-a-way-to-dynamically-group-overlapping-events/337290/1 "2023-06-30T09:03:29Z")

</div>

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 es ? 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.

---

<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 28, 2023, 9:04am UTC](https://discuss.elastic.co/t/is-there-a-way-to-dynamically-group-overlapping-events/337290/2 "2023-07-28T09:04:11Z")

</div>

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