Splunk Search

Search for host name where hostname is not an IP

hartfoml
Motivator

When I use the | metadata type=hosts I see all my servers as well as network equipment that have host as the IP of the device.

I would like to do the search and leave out all the IPs under host and only get the ones that have alphanumeric hostnames

0 Karma
1 Solution

skawasaki_splun
Splunk Employee
Splunk Employee
| metadata type=hosts | regex host!="^(?:\d{1,3}\.){3}\d{1,3}"

Use regex to find all host that doesn't follow the IPv4 address like 223.34.2.99.

More info about regex: http://docs.splunk.com/Documentation/Splunk/6.2.1/SearchReference/regex

View solution in original post

skawasaki_splun
Splunk Employee
Splunk Employee
| metadata type=hosts | regex host!="^(?:\d{1,3}\.){3}\d{1,3}"

Use regex to find all host that doesn't follow the IPv4 address like 223.34.2.99.

More info about regex: http://docs.splunk.com/Documentation/Splunk/6.2.1/SearchReference/regex

hartfoml
Motivator

Thanks Much @skawasaki_splunk I gave you 5 points but this was too easy for you. Thanks again for the help.

0 Karma
Get Updates on the Splunk Community!

Webinar Recap | Revolutionizing IT Operations: The Transformative Power of AI and ML ...

The Transformative Power of AI and ML in Enhancing Observability   In the realm of IT operations, the ...

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...