Splunk Search

Rounding Decimal Places

cramasta
Builder

Hi, I have the following

| chart eval(sum(Failed)/sum(TotalEvents)*100) AS PercentFailed

I would like to round the value that it produces to 2 decimal places. I have been unsuccessful trying to add in the round command. Anyone have any suggestions on how to do this?

Tags (2)
1 Solution

ftk
Motivator

You can use round as follows:

| chart eval(round((sum(Failed)/sum(TotalEvents)*100),2)) AS PercentFailed

View solution in original post

ftk
Motivator

You can use round as follows:

| chart eval(round((sum(Failed)/sum(TotalEvents)*100),2)) AS PercentFailed

cramasta
Builder

thank you so much !

0 Karma
Get Updates on the Splunk Community!

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...