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!

[Puzzles] Solve, Learn, Repeat: Dynamic formatting from XML events

This challenge was first posted on Slack #puzzles channelFor a previous puzzle, I needed a set of fixed-length ...

Enter the Agentic Era with Splunk AI Assistant for SPL 1.4

  🚀 Your data just got a serious AI upgrade — are you ready? Say hello to the Agentic Era with the ...

Stronger Security with Federated Search for S3, GCP SQL & Australian Threat ...

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...