Splunk Search

Calculating the number of executions using streamstats

andreafebbo
Communicator

Hi! I have such table:

package executionID type day time
A 1 start day1 some_hour
A 1 end day1 some_hour
B 1 start day1 some_hour
B 2 start day1 some_hour
B 2 end day1 some_hour

Id like to identify (counting) the execution, so obtaining something like this:

A 1 start day1 some_hour 1 (start of the first exec of package A in day1)
A 1 end day1 some_hour 1 (end of the first exec of package A in day1)
B 1 start day1 some_hour 1 (start of the first exec of package B in day1)
B 2 start day1 some_hour 2 (start of the second exec of package B in day1)
B 2 end day1 some_hour 2 (end of the second exec of package B in day1)

I tried everything i could with streamstats but i could not do it.

Thank you

somesoni2
Revered Legend

Try this

your current search giving package executionID type day time
| eval count=if(type="start",1,0)
| streamstats sum(count) as count by day
0 Karma
Get Updates on the Splunk Community!

Splunk Enterprise Security(ES) 7.3 is approaching the end of support. Get ready for ...

Hi friends!    At Splunk, your product success is our top priority. With Enterprise Security (ES), we're here ...

Splunk Enterprise Security 8.x: The Essential Upgrade for Threat Detection, ...

Watch On Demand the Tech Talk, and empower your SOC to reach new heights! Duration: 1 hour  Prepare to ...

Splunk Observability for AI

Don’t miss out on an exciting Tech Talk on Splunk Observability for AI!Discover how Splunk’s agentic AI ...