Splunk Search

How to search and calculate the average for the top 70 percent of a field?

bkcstone
Engager

How to calculate the average for top 70%. A field in log contains a value. I need to ignore the least 30% and then calculate average.

Tags (3)
1 Solution

strive
Influencer

Try this

some search terms.. | sort 0 - Field_Of_Interest | streamstats count as Rank | eventstats count as TotalRows | where Rank<(TotalRows * 0.7) | stats avg(Field_Of_Interest) as Required_Average

View solution in original post

strive
Influencer

Try this

some search terms.. | sort 0 - Field_Of_Interest | streamstats count as Rank | eventstats count as TotalRows | where Rank<(TotalRows * 0.7) | stats avg(Field_Of_Interest) as Required_Average
Get Updates on the Splunk Community!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

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 GA in US-AWS!

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