Splunk Search

Calculating Percentage

vinod743374
Communicator

vinod743374_0-1626105167460.png

i just want to calculate the Passed Percentage of every date .

i have the Passed Count as well as the Total devices.

is there any logic to calculate the % for every date Dynamically , because there are few more data to be added with a different date.

Please help me , is there any possibility to do that .

it would be appreciated,
Thank you.

Labels (3)
0 Karma
1 Solution

richgalloway
SplunkTrust
SplunkTrust

Try foreach.  It iterates over fields that match a pattern and performs specified commands on each.

| foreach Passed* [eval "Pct<<MATCHSTR>>" = '<<FIELD>>'*100/'Total<<MATCHSTR>>'
---
If this reply helps you, Karma would be appreciated.

View solution in original post

richgalloway
SplunkTrust
SplunkTrust

Try foreach.  It iterates over fields that match a pattern and performs specified commands on each.

| foreach Passed* [eval "Pct<<MATCHSTR>>" = '<<FIELD>>'*100/'Total<<MATCHSTR>>'
---
If this reply helps you, Karma would be appreciated.
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 &#43; Cisco at "Ludicrous Scale"   You know Splunk. You know Cisco. But have you seen ...