Splunk Search

Count of hosts in to Single value dashboard module

MBerikcurtis
Path Finder

I'm using

index=main earliest=-1d@d latest=@d | stats distinct_count(host) by host | addcoltotals fieldname=sum | rangemap field=sum

in an attempt to get a count of hosts in to a single value module on a dashboard. Using this search, I get the name of the first host in the single value module.

Tags (2)
0 Karma
1 Solution

gkanapathy
Splunk Employee
Splunk Employee

I don't see why you are using a command that complex, or why you're using rangemap at all. (And in general, rangemap is a terrible command. If you need the functionality, eval's case() function is better in every way.) Why not just:

... | stats distinct_count(host) as hostcount

and then just display the hostcount field in your singlevalue

View solution in original post

gkanapathy
Splunk Employee
Splunk Employee

I don't see why you are using a command that complex, or why you're using rangemap at all. (And in general, rangemap is a terrible command. If you need the functionality, eval's case() function is better in every way.) Why not just:

... | stats distinct_count(host) as hostcount

and then just display the hostcount field in your singlevalue

Get Updates on the Splunk Community!

Enterprise Security Content Update (ESCU) | New Releases

In November, the Splunk Threat Research Team had one release of new security content via the Enterprise ...

Index This | Divide 100 by half. What do you get?

November 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with this ...

Stay Connected: Your Guide to December Tech Talks, Office Hours, and Webinars!

❄️ Celebrate the season with our December lineup of Community Office Hours, Tech Talks, and Webinars! ...