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.

Labels (1)
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!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...