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!

Automatic Discovery Part 1: What is Automatic Discovery in Splunk Observability Cloud ...

If you’ve ever deployed a new database cluster, spun up a caching layer, or added a load balancer, you know it ...

Real-Time Fraud Detection: How Splunk Dashboards Protect Financial Institutions

Financial fraud isn't slowing down. If anything, it's getting more sophisticated. Account takeovers, credit ...

Splunk + ThousandEyes: Correlate frontend, app, and network data to troubleshoot ...

 Are you tired of troubleshooting delays caused by siloed frontend, application, and network data? We've got a ...