Getting Data In

How can I easily filter or limit my search down to a specific group of hosts?

maverick
Splunk Employee
Splunk Employee

I have lots of hosts in my environment, but I only want to search across a few of them from time to time. Can I somehow make it easy to search across only some specific hosts and not all of them in my search without having to list them all out with boolean ORs between them?

For example, if I have one hundred servers total and I only want to search across my 20 web server hosts, I do not want to list all twenty hosts in a search every time.

How can I make this easier to do this, or is this the only way?

gkanapathy
Splunk Employee
Splunk Employee

Here is another way that is general for any field:

http://answers.splunk.com/questions/730/how-to-search-multiple-value-on-the-same-field/734#734

using a Splunk lookup table.

maverick
Splunk Employee
Splunk Employee

Yes, you can abstract the twenty hosts into a host group tag called "web_servers" or something similar.

Then you could search using the host group tag instead of listing the hosts names within the search, like this:

tag="web_servers"

See this page on how to tag your hosts names with the same host group tag:

http://docs.splunk.com/Documentation/Splunk/5.0/Knowledge/Tagthehostfield

Another way you could search might be to include a wildcard in the host name value itself, like this:

host="Mav*"

which would find hosts names Mav01, Mav02, Mav03, etc.

You can also do it with ip addresses too like this:

host="10.21.0.*"

which would search across only the ips that start with "10.21.0"

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!

Take Action Automatically on Splunk Alerts with Red Hat Ansible Automation Platform

 Are you ready to revolutionize your IT operations? As digital transformation accelerates, the demand for ...

Calling All Security Pros: Ready to Race Through Boston?

Hey Splunkers, .conf25 is heading to Boston and we’re kicking things off with something bold, competitive, and ...

Beyond Detection: How Splunk and Cisco Integrated Security Platforms Transform ...

Financial services organizations face an impossible equation: maintain 99.9% uptime for mission-critical ...