Splunk Search

How to list all hosts under a certain sourcetype?

AaronMoorcroft
Communicator

Hey Guys

So I have a sourcetype of syslog, but under that sourcetype seems to be a whole bunch of hosts. What's the best search to list all the hosts sending under the syslog sourcetype?

Sorry for such a basic question, I'm not too bad at making Splunk work, but actually using it for searches etc I'm not so hot.

Cheers

Aaron

0 Karma
1 Solution

vasildavid
Path Finder
sourcetype=syslog | stats count by host

Or, you could use something like this to see how much data each host is sending:

sourcetype=syslog | eval length=len(_raw) | stats sum(length) by host

View solution in original post

0 Karma

muebel
SplunkTrust
SplunkTrust

Hi Aaron, if you wanted a quick simple count, this might be a good use for tstats, which will usually finish faster than a normal search.

| tstats count where sourcetype=syslog by host

somesoni2
Revered Legend

I can vouch for that

0 Karma

AaronMoorcroft
Communicator

Thank you, that also seems to work well, no doubt ill be needing more help with some simple searches over the coming days. I have to try and break down everything that is being logged into categories and generally have a tidy up.

0 Karma

vasildavid
Path Finder
sourcetype=syslog | stats count by host

Or, you could use something like this to see how much data each host is sending:

sourcetype=syslog | eval length=len(_raw) | stats sum(length) by host
0 Karma

AaronMoorcroft
Communicator

That Iooks to be doing what I need, thank you Sir...

0 Karma
Get Updates on the Splunk Community!

Detecting Remote Code Executions With the Splunk Threat Research Team

REGISTER NOWRemote code execution (RCE) vulnerabilities pose a significant risk to organizations. If ...

Observability | Use Synthetic Monitoring for Website Metadata Verification

If you are on Splunk Observability Cloud, you may already have Synthetic Monitoringin your observability ...

More Ways To Control Your Costs With Archived Metrics | Register for Tech Talk

Tuesday, May 14, 2024  |  11AM PT / 2PM ET Register to Attend Join us for this Tech Talk and learn how to ...