Splunk Search

How to achieve average of first 7 vs last 7 records?

agupta13
Engager

Hi team,

I have 14 records in the table,  I want to find out average of first 7 and average of last 7 records

How can I do that? Here I want avg of first 7 entries and then average of last 7 entries

agupta13_0-1681233183103.png

 

Labels (2)
0 Karma
1 Solution

ITWhisperer
SplunkTrust
SplunkTrust
| streamstats count as row
| eval row=if(row<=7,1,2)
| stats avg(count) as average by row

View solution in original post

ITWhisperer
SplunkTrust
SplunkTrust
| streamstats count as row
| eval row=if(row<=7,1,2)
| stats avg(count) as average by row
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 ...