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!

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...

New in Observability Cloud - Explicit Bucket Histograms

Splunk introduces native support for histograms as a metric data type within Observability Cloud with Explicit ...