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!

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 ...