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!

Now Available: Cisco Talos Threat Intelligence Integrations for Splunk Security Cloud ...

At .conf24, we shared that we were in the process of integrating Cisco Talos threat intelligence into Splunk ...

Preparing your Splunk Environment for OpenSSL3

The Splunk platform will transition to OpenSSL version 3 in a future release. Actions are required to prepare ...

Easily Improve Agent Saturation with the Splunk Add-on for OpenTelemetry Collector

Agent Saturation What and Whys In application performance monitoring, saturation is defined as the total load ...