Splunk Search

How to derive earliest and latest from a list of events that overlap in timespans

neusse
Path Finder

I need to roll up several events with overlapping start and stop times. I need the total time of the events without doing a sum of the elapsed time for each event.

Each event in the series has a start time and an end time. The times may or may not overlap. The results need to be one or more time spans that equal the earliest and latest for each consecutive amount of time.
alt text

The green are the event time spans and the red is the needed result time. I am at a loss as to how to approach this.

Thanks.

0 Karma

twinspop
Influencer
... | stats min(_time) as start max(_time) as end by some_key_in_your_events | eval span_seconds=end-start 
0 Karma

neusse
Path Finder

Is there a way to detect gaps in the middle like the chart shows above? So the red is two time spans. I can think of a way to detect that. If the data is always overlapping this works. But my data is not always overlapping.

Thanks,

0 Karma
Get Updates on the Splunk Community!

Get Your Exclusive Splunk Certified Cybersecurity Defense Engineer at Splunk .conf24 ...

We’re excited to announce a new Splunk certification exam being released at .conf24! If you’re headed to Vegas ...

Share Your Ideas & Meet the Lantern team at .Conf! Plus All of This Month’s New ...

Splunk Lantern is Splunk’s customer success center that provides advice from Splunk experts on valuable data ...

Combine Multiline Logs into a Single Event with SOCK: a Step-by-Step Guide for ...

Combine multiline logs into a single event with SOCK - a step-by-step guide for newbies Olga Malita The ...