Splunk Search

Converting Percentages to Decimal based Percentages

Dark_Ichigo
Builder

I want to change the percentage results of the follwoing search into decimal based Percentages, as I want the 0.5% for example to show instead of just a 0%

The following search:

index="<index>"   | eventstats sum(S1) as S1 | eventstats sum(S1) as S2 by seconds | eval S_final = S2*100/S1 | chart first(S_final) as S_Solution by seconds 

I also would like to know how to add the percentile Unit to the values, is that possible?

0 Karma
1 Solution

yannK
Splunk Employee
Splunk Employee

For results in table you can concatenate the field with a string.


eval S_final=(S2*100/S1)."%"

but for a graph, it's more on the options of the dashboard.

View solution in original post

yannK
Splunk Employee
Splunk Employee

For results in table you can concatenate the field with a string.


eval S_final=(S2*100/S1)."%"

but for a graph, it's more on the options of the dashboard.

Dark_Ichigo
Builder

Thanks for that, I wanted to add percentage units to the table view and it worked fine.

I also managed to solve the issue with the search results to be floating point based numbers instead of whole numbers and it was the summary indexed data that was playing up so I just ran another backfill script 🙂

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 ...