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!

Automatic Discovery Part 1: What is Automatic Discovery in Splunk Observability Cloud ...

If you’ve ever deployed a new database cluster, spun up a caching layer, or added a load balancer, you know it ...

Real-Time Fraud Detection: How Splunk Dashboards Protect Financial Institutions

Financial fraud isn't slowing down. If anything, it's getting more sophisticated. Account takeovers, credit ...

Splunk + ThousandEyes: Correlate frontend, app, and network data to troubleshoot ...

 Are you tired of troubleshooting delays caused by siloed frontend, application, and network data? We've got a ...