Splunk Search

How to find IP addresses events are coming from to verify if multiple VMs are under a single hostname?

di2esysadmin
Path Finder

I suspect that multiple VMs (as yet unconfigured in our environment) are getting lumped together in the index under a single hostname ("unconfigured-win2008r2"). I'd like to verify this by finding the IP addresses that these events are coming from.

How do I do this?

thanks.

Tags (2)
0 Karma

BP9906
Builder

I have a search labeled for this reason.
Splunk - Multiple machine reporting as same host (runs every 60m -1h@h - now)

I found that the RHEL kickstart with our splunkforwarder rpm always puts localhost in server.conf and inputs.conf so I have to go change it in etc/system/local. Alternatively, we get systems folks who duplicate servers (virtual), change server name, and dont tell me. This search handles all of the above.


index=internal sourcetype=splunkd hostname="*" | rex "(?i)hostname=(?P[\w-]+)" | stats count values(sourceIp) dc(sourceIp) as dup dc(guid) as dup_guid by agentname| where (agentname="localhost" OR dup>1 OR dup_guid>1) | search NOT (agentname="server1" OR agentname="server2")

server1 and server2 are known servers that have 2 or more IPs. This allows me to ignore servers with these names.

0 Karma

ppeterson
Path Finder

Did anyone get this regex to work?

0 Karma

BP9906
Builder

The above search I posted resolved my issue.

0 Karma

somesoni2
Revered Legend

Assuming that those VMs are hosting forwarder to send the data, they should be sending heartbeat to Splunk Indexer, which contains IP. Try this

index=_internal group="tcpin_connections" | table hostname sourceHost | dedup  hostname sourceHost
0 Karma

somesoni2
Revered Legend

I believe the hostname may not be available in all events (sometime just the IP is logged). Try these and see if you can get host name in any of the event.

index=internal group=tcp* OR group=per* OR group=ds_* | table *host* *Host* *ip* *Ip* *IP*

0 Karma

di2esysadmin
Path Finder

This is interesting. The hostname I'm suspicious of doesn't even appear in the resultant table. Why would that be?

0 Karma

richgalloway
SplunkTrust
SplunkTrust

You'll need to find the field(s) in your index that contain IP addresses. One way to do that is

<your search> | fields - _* | table *

This will list all of the fields available to you (except _raw, _time, etc.) and their values. Look through the table for meaningful values and then add the fields to your query.

---
If this reply helps you, Karma would be appreciated.
0 Karma

di2esysadmin
Path Finder

For these apparently windows hosts, my query didn't include any IP addresses. Actually I tried this with a handful of centos hosts too. No IP addresses either.

0 Karma
Get Updates on the Splunk Community!

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...

New in Observability Cloud - Explicit Bucket Histograms

Splunk introduces native support for histograms as a metric data type within Observability Cloud with Explicit ...