Splunk Search

Transaction or Stats - need multiple starts and ends without the hundreds of thousands of events between each start & end

mrpaul
Explorer

I am looking for a way to identify the start and end of a burst of events that has hundreds of thousands of events in each burst. I don't need the individual events themselves. This sounds like a perfect use for stats, except, multiple bursts can happen during the search period, and I need the start and end times of each burst.

For example, I may run a search over the past 24 hours, and during that time, there may be three or four bursts.

I can assume if there is a gap of 5 minutes or more, the burst has ended. Any given burst may last for minutes or an hour or so.

I have tried using a transaction with maxpause=5m and maxopenevents=100000, but the huge number of events is causing problems.

The events are all similar with no identifiers I could use to filter out everything but the start and end events (that would have simplified this!)

Thanks for your thoughts!

Mr Paul

1 Solution

woodcock
Esteemed Legend

Let's assume you have a field called status that has (at least) values like start and end; then you can use streamstats like this:

... | streamstats count earliest(_time) AS startTime latest(_time) AS endTime latest(status) AS lastStatus | count(eval(status="start")) AS sessionID | stats values(*) AS * BY sessionID

View solution in original post

woodcock
Esteemed Legend

Let's assume you have a field called status that has (at least) values like start and end; then you can use streamstats like this:

... | streamstats count earliest(_time) AS startTime latest(_time) AS endTime latest(status) AS lastStatus | count(eval(status="start")) AS sessionID | stats values(*) AS * BY sessionID

sideview
SplunkTrust
SplunkTrust

Sounds like you need a different approach that uses eval, streamstats and stats. If you can identify the start and end of the bursts with transaction, then chances are you can paint some marker fields onto these events with eval.

Can you post specific examples of the start and end events as well as some of the 'filler' in between? I can update this comment and then turn it into an answer.

Get Updates on the Splunk Community!

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...