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!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

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 GA in US-AWS!

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