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!

UCC Framework: Discover Developer Toolkit for Building Technology Add-ons

The Next-Gen Toolkit for Splunk Technology Add-on Development The Universal Configuration Console (UCC) ...

.conf25 Community Recap

Hello Splunkers, And just like that, .conf25 is in the books! What an incredible few days — full of learning, ...

Splunk App Developers | .conf25 Recap & What’s Next

If you stopped by the Builder Bar at .conf25 this year, thank you! The retro tech beer garden vibes were ...