Splunk Search

Query to list index name sourcetype for 100+ hosts using IN command

manchou0709
Explorer

Hi everyone, 

I am trying to find out index name , sourcetype for 100+  (128) hosts. Since I am working in a multisite cluster where all 3 SH can communicate with each other, I am trying to avoid using index=*
I have tried below queries but none works -

| metadata type=hosts | search host IN ("host1","host2","host3") | rename _meta_index as index | join host index [ | stats values(sourcetype) as sourcetype by host index ]
| tstats count where host IN (host1, host2, host3,.. hostn) by index sourcetype

as well as stats query none works.

Please help!

 

Labels (3)
0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

In what way do they not work? Please can you be more specific about your issue.

Having said that, multi-value fields from stats are often truncated to 100 entries. You could try adding

limit=128

or even

limit=0
0 Karma

bowesmana
SplunkTrust
SplunkTrust

@ITWhisperer MV from stats values() has no limit, but stats list() does have the 100 limit...

Have you ever seen values get truncated?

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

May 2026 Splunk Expert Sessions: Security & Observability

Level Up Your Operations: May 2026 Splunk Expert Sessions Whether you are refining your security posture or ...

Network to App: Observability Unlocked [May & June Series]

In today’s digital landscape, your environment is no longer confined to the data center. It spans complex ...

SPL2 Deep Dives, AppDynamics Integrations, SAML Made Simple and Much More on Splunk ...

Splunk Lantern is Splunk’s customer success center that provides practical guidance from Splunk experts on key ...