Splunk Search

How to calculate average rate of occurrence for a field?

_gkollias
Builder

Hello,

I am looking for a way to calculate the avg rate of occurrence for a particular field. There are multiple values given in this field, but we want to see at the avg rate how often they occur.

Here is the simple base search which finds all values for exit_status:

index=contract_gateway_summary  earliest=-14d@d | stats count by exit_status  | dedup exit_status

Any help would be greatly appreciated.

Thanks in advance!

Tags (4)
0 Karma

somesoni2
Revered Legend

Try this. Adjust the span based on your avg rate period (showing avg count per day with span=1d, for avg count per hour, change span=1h etc)

index=contract_gateway_summary  earliest=-14d@d | bucket span=1d _time | stats count by _time exit_status | stats avg(count) as AvgPerDay by exit_status
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 ...