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!

Splunk Observability Cloud's AI Assistant in Action Series: Auditing Compliance and ...

This is the third post in the Splunk Observability Cloud’s AI Assistant in Action series that digs into how to ...

Splunk Community Badges!

  Hey everyone! Ready to earn some serious bragging rights in the community? Along with our existing badges ...

What You Read The Most: Splunk Lantern’s Most Popular Articles!

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...