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!

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

Introducing Splunk Enterprise 9.2

WATCH HERE! Watch this Tech Talk to learn about the latest features and enhancements shipped in the new Splunk ...

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...