Splunk Search

Average of multiple fields

msarro
Builder

I have three columns each containing a number. I want to have the average for each rows set of numbers. Is there a way to do this with the avg command?

i would like to be able to do something like the following

avg(AS_KPI_SCORE_AVG, PSBC_KPI_SCORE_AVG, PCSCF_KPI_SCORE_AVG)

Tags (2)

David
Splunk Employee
Splunk Employee

I know stats is usually used vertically (one field, summing that way). There may be another method that would work, but you can certainly do it with eval:

YourSearch | eval Average = (AS_KPI_SCORE_AVG + PSBC_KPI_SCORE_AVG + PCSCF_KPI_SCORE_AVG) / 3
Get Updates on the Splunk Community!

Tech Talk Recap | Mastering Threat Hunting

Mastering Threat HuntingDive into the world of threat hunting, exploring the key differences between ...

Observability for AI Applications: Troubleshooting Latency

If you’re working with proprietary company data, you’re probably going to have a locally hosted LLM or many ...

Splunk AI Assistant for SPL vs. ChatGPT: Which One is Better?

In the age of AI, every tool promises to make our lives easier. From summarizing content to writing code, ...