Splunk Search

how to edit my search to display list of hosts instead of count?

chanamoluk
Explorer

i have written the following search to generate list of sourcetype and indexes with host count, but i want to list all the hosts instead of count,
can you please help me in it....

|metasearch index=* | dedup index sourcetype host| stats dc(host) AS hostcount,values(sourcetype) AS stlist by index

alt text

please check the image where i want to chagne my query for list of hosts

0 Karma

gokadroid
Motivator

Change the dc(host) AS hostcount to values(host) AS hostvalues. Something like this:

|metasearch index=* | dedup index sourcetype host| stats values(host) AS hostvalues,values(sourcetype) AS stlist by index
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 ...