Splunk Search

How to get average value of fields?

sekhar463
Path Finder

hi all,

i have some events with a field called RUNTIME for each job.

how can i get the average value of RUNTIME for each of the job and result will be on new field

 

Labels (2)
0 Karma

yuanliu
SplunkTrust
SplunkTrust

I assume "results will be new field" means that you want the average along with raw events.  In this case, eventstats is your friend.

| eventstats avg(RUNTIME) AS RUNTIME_avg BY JOID

 

Tags (1)
0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @sekhar463 ,

pease try something like this:

<your_search>
| stats avg(RUNTIME) AS RUNTIME_avg BY JOID

Ciao.

Giuseppe

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust
| stats avg(RUNTIME) as average_runtime
0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Why Splunk Customers Should Attend Cisco Live 2026 Las Vegas

Why Splunk Customers Should Attend Cisco Live 2026 Las Vegas     Cisco Live 2026 is almost here, and this ...

What Is the Name of the USB Key Inserted by Bob Smith? (BOTS Hint, Not the Answer)

Hello Splunkers,   So you searched, “what is the name of the usb key inserted by bob smith?”  Not gonna lie… ...

Automating Threat Operations and Threat Hunting with Recorded Future

    Automating Threat Operations and Threat Hunting with Recorded Future June 29, 2026 | Register   Is your ...