Dashboards & Visualizations

How to round off the result for a single value visualization to the nearest million?

mwdbhyat
Builder

Hi,

I have the following search:

| tstats count WHERE index=test earliest=-2mon@mon by _time span=1mon

The result is displayed in a single value visualization with a trend. I want to round the result off to the nearest million.. Any thoughts on how to do this?

Thanks

0 Karma
1 Solution

masonmorales
Influencer

You could do something like this:

| tstats count WHERE index=test earliest=-2mon@mon by _time span=1mon | eval count=round(count/1000000)*1000000

You could also do this, but it might break your trend line:

| tstats count WHERE index=test earliest=-2mon@mon by _time span=1mon | eval count=tostring(round(count/1000000))." M" 

View solution in original post

0 Karma

somesoni2
Revered Legend

Give this a try

| tstats count WHERE index=test earliest=-2mon@mon by _time span=1mon | eval count=round(count/1000000)*1000000
0 Karma

masonmorales
Influencer

You could do something like this:

| tstats count WHERE index=test earliest=-2mon@mon by _time span=1mon | eval count=round(count/1000000)*1000000

You could also do this, but it might break your trend line:

| tstats count WHERE index=test earliest=-2mon@mon by _time span=1mon | eval count=tostring(round(count/1000000))." M" 
0 Karma
Get Updates on the Splunk Community!

.conf24 | Day 0

Hello Splunk Community! My name is Chris, and I'm based in Canberra, Australia's capital, and I travelled for ...

Enhance Security Visibility with Splunk Enterprise Security 7.1 through Threat ...

(view in My Videos)Struggling with alert fatigue, lack of context, and prioritization around security ...

Troubleshooting the OpenTelemetry Collector

  In this tech talk, you’ll learn how to troubleshoot the OpenTelemetry collector - from checking the ...