Splunk Search

Help showing top tenants by number of hosts in pie chart

marcorivera
Loves-to-Learn Lots

I would like to make a pie chart which shows the Top 10 tenants by number of hosts and then put everything else under the label "other".

Currently, I am doing this:

| stats sum(hostsCount) as hostsCount by TenantName
| sort hostsCount desc

 

marcorivera_0-1652191180864.png

 

The issue with this is that it truncates the TenantNames to 10000 as shown in the screenshot which makes the "other" category's hostsCount not accurate. There are over 30000 TenantNames/hostsCount.

I would like to change this Pie chart to:

1. Display the Top 10  tenants by hostsCount

2. Make a label called "other" and put all the remaining hostsCounts in them so that it displays the accurate percentage/amount.

What would be the best way to do this?

Labels (6)
0 Karma

venky1544
Builder

hi @marcorivera 

apologies i read the question wrong you can ignore the top command

your earlier query is correct 

If you save the piechart in a dashboard, and then you can use the charting.data.count option to set a higher limit (even unlimited (0)).

https://docs.splunk.com/Documentation/SplunkCloud/8.2.2202/Viz/ChartConfigurationReference

venky1544_0-1652262003904.png

 

P.S if it helps karma points are appreciated 

0 Karma

venky1544
Builder

Hi @marcorivera 

just try 

your search | top limit=10 useother=true hostsCount

if it helps karma points are appreciated /if it resolves solution acceptance is appreciated 

0 Karma

marcorivera
Loves-to-Learn Lots

@venky1544 Sorry, I'm new to Splunk.. when I tried putting the  "| top limit=10..." command at the bottom, it did not work and resulted into this. Am I doing it incorrectly?

Screenshot 2022-05-10 105634.pngScreenshot 2022-05-10 105711.png

0 Karma
Get Updates on the Splunk Community!

Fastest way to demo Observability

I’ve been having a lot of fun learning about Kubernetes and Observability. I set myself an interesting ...

September Community Champions: A Shoutout to Our Contributors!

As we close the books on another fantastic month, we want to take a moment to celebrate the people who are the ...

Splunk Decoded: Service Maps vs Service Analyzer Tree View vs Flow Maps

It’s Monday morning, and your phone is buzzing with alert escalations – your customer-facing portal is running ...