Getting Data In
Highlighted

source files associated with a host

Path Finder

How can I easily search through Splunk to figure out which sources are associated with a specific host?

I know I could just set the time frame to be "all time", but that is not realistic since there are millions of entries total for all the various source files associated with this host.

Any suggestions?

Thanks, Sean

Tags (2)
Highlighted

Re: source files associated with a host

Contributor

Searching for host<->source associations over all time is relatively efficient in Splunk:

host=MY_HOST | top limit=1000 source

Splunk does not keep cross-product information between host/source/sourcetype indexed. If you need this information on a regular basis, scheduling the above search to run on a periodic basis will ensure that you always have quick access to the info.

View solution in original post

Highlighted

Re: source files associated with a host

SplunkTrust
SplunkTrust

Indeed as Johnvey mentioned the following report is the best and simplest way to get the sources for a particular host:

host=MY_HOST | top limit=1000 source

You may also find stats values(sources) by host useful though, for looking across all your hosts. This is definitely going to be a long running report so its best to follow these instructions:

a) leave the default search UI behind and go to the 'advanced charting view' (aka /app/search/charting) Its a lot faster, if you know you're running a report, to run it in this view as compared with running them in the main search UI. b) kick off one of the reports below c) check 'enable preview' if it isnt already. d) watch the table coming in. e) turn off 'enable preview' (this will make it run slightly faster) f) Actions > Get link to results g) save that link somewhere. This is in case you run the report for so long that you get logged out of the UI. h) go get a cup of coffee etc. i) when its scanned an appropriately vast amount of events, click 'finalize'.

So this first report will give you the distinct sources present from each host, and it'll claw back through the data building the data for as long as you let it.

* | stats values(sources) by host

And if you have a TON of hosts, you can find it very useful to pipe the output of that search into the cluster command, which will automatically categorize the hosts into clusters. This can be very useful to quickly spot hosts that arent behaving like their brethren:

* | stats values(source) as sources by host | cluster field=sources

View solution in original post