Splunk Search

Issue in Splunk round function

keerthana_k
Communicator

Hi

I have a timechart where I am displaying 4 values as a percent. My search query is like this:

.......| eval Percent1=Count1*100/(Count1+Count2+Count3+Count4)  | eval Percent2=Count2*100/(Count1+Count2+Count3+Count4)  | eval Percent3=Count3*100/(Count1+Count2+Count3+Count4)  | eval Percent4=Count4*100/(Count1+Count2+Count3+Count4)  | timechart partial=false span=1h first(Percent1) as Percent1 first(Percent2) as Percent2 first(Percent3) as Percent3 first(Percent4) as Percent4 

I am using stacked area chart to display these values. Ideally, the total of all the Percent values should be 100. But I am getting 100.000001 or 99.999999 as the total. I tried rounding the values to two decimal places but 100.000001 is rounded off to 100.01 and 99.999999 is getting rounded off to 99.99. Can anyone tell me why this happens? How do I overcome this?

Thanks in Advance

Tags (1)
0 Karma

kristian_kolb
Ultra Champion
0 Karma

keerthana_k
Communicator

Hi. Thanks for your help. But I am still facing the same issue.

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