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!

Introducing the Splunk Community Dashboard Challenge!

Welcome to Splunk Community Dashboard Challenge! This is your chance to showcase your skills in creating ...

Wondering How to Build Resiliency in the Cloud?

IT leaders are choosing Splunk Cloud as an ideal cloud transformation platform to drive business resilience,  ...

Updated Data Management and AWS GDI Inventory in Splunk Observability

We’re making some changes to Data Management and Infrastructure Inventory for AWS. The Data Management page, ...