Splunk Search

Percentages in Search Query

sandyrite87
Loves-to-Learn

I'm having trouble formulating a search query for the following data:

When the number of "tests-failed" has exceeded 20% of "tests-total".

How do you do percentages?

P.S. i'm working with metrics data.

Tags (2)
0 Karma

bowesmana
SplunkTrust
SplunkTrust

Use eval

 

| eval percent=round(testsfailed/teststotal*100,2)

Assuming your field names are as above. If you want to use 'tests-failed' and 'tests-total' then you need to wrap those field names in single quotes in the eval statement.

 

 

0 Karma
Get Updates on the Splunk Community!

Application management with Targeted Application Install for Victoria Experience

  Experience a new era of flexibility in managing your Splunk Cloud Platform apps! With Targeted Application ...

Index This | What goes up and never comes down?

January 2026 Edition  Hayyy Splunk Education Enthusiasts and the Eternally Curious!   We’re back with this ...

Splunkers, Pack Your Bags: Why Cisco Live EMEA is Your Next Big Destination

The Power of Two: Splunk + Cisco at "Ludicrous Scale"   You know Splunk. You know Cisco. But have you seen ...