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!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

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