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!

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...

New in Observability Cloud - Explicit Bucket Histograms

Splunk introduces native support for histograms as a metric data type within Observability Cloud with Explicit ...