Splunk Search

How to refine search to pull the hosts that has 100+ results?

wrongquery
Explorer

So based off my original query that shows 100+ hosts, I would like to generate a list of the hosts in statistics but my query isn't populating. It's worked before but for some reason none of the queries that are similar to this one are working. Suggestions on refining my query?

index=* sourcetype=* | stats count as host by "selected fields" | stats list(host) as host list(selected fields) as "selected fields"

Labels (2)
0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

When something stops working you should look for what has changed - for example, have you upgraded Splunk? Is data still coming into Splunk? etc.

wrongquery
Explorer

Yes data is still coming into splunk. I've tried last four, 24, and 7 days. If I just do index=* and sourcetype=* which I understand can be a lot of data I get information, but when i do my stats it won't show but my stats was working before. Does the query look like it should work?

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Assuming you have a field called "selected fields" or this is replaced by real field names, then the search looks like it should work.

What has changed in your environment from when it was working to when it stopped working?

wrongquery
Explorer

Nothings changed from what I can see, the selected fields is just the top three. Host, source, and sourcetype.  Maybe just try other queries for the time being and come back to it?

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

You could try metasearch

| metasearch
| dedup host sourcetype source
| fields host sourcetype source
| stats list(*) as *

wrongquery
Explorer

No luck my friend

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Can’t Make It to Boston? Stream .conf25 and Learn with Haya Husain

Boston may be buzzing this September with Splunk University and .conf25, but you don’t have to pack a bag to ...

Splunk Lantern’s Guide to The Most Popular .conf25 Sessions

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Unlock What’s Next: The Splunk Cloud Platform at .conf25

In just a few days, Boston will be buzzing as the Splunk team and thousands of community members come together ...