Getting Data In

Blank or null hostname (host="")How do I find the server?

jcarpio9
Engager

I have a server forwarding events to splunk that must be configured incorrectly. It's hostname is blank and can be found while using this search string

host=""

How can I use splunk to determine the origin (IP or real hostname) of the forwarding server to correct its blank hostname?

Tags (1)

lukejadamec
Super Champion

Try this for a windows computer:

index=main ComputerName="*" | fillnull value=NoHostName host | dedup ComputerName | table ComputerName,host

And, look in the table for a ComputerName with NoHostName.

For a unix host, if you're collecting interface information, then this should work for finding the interface IP.

index=os | search sourcetype="interfaces" |rex field=_raw (?msi).*\s(?<interfaceIP>\d+\.\d+\.\d+\.\d+) |dedup interfaceIP | fillnull value=NoHostName host |table interfaceIP,host

jcarpio9
Engager

Hmm, it's definitely a Windows box (I see perfmon stats) but the first query didn't return a hit. I'll keep digging.

0 Karma

kristian_kolb
Ultra Champion

Clever indeed.

0 Karma

kphillipson
Path Finder

If I understand your question, you are referring to the forward server's own files not showing a host name when they are indexed at the indexer.

Look under .../splunk/etc/system/local at the inputs.conf file on the forwarder. You should see something like this:
[default]
host = servername

If the forward server is forwarding logs from other hosts (ie: syslog-ng) then you can define where the hostname is pulled from in the inputs.conf file.

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Event Series: Level up your SOC: Advancing with Splunk Enterprise Security

AI has fundamentally raised the stakes for security operations, and this three-part series is your guide to ...

Announcing Modern Navigation: A New Era of Splunk User Experience

We are excited to introduce the Modern Navigation feature in the Splunk Platform, available to both cloud and ...

SOC4Kafka - New Kafka Connector Powered by OpenTelemetry

The new SOC4Kafka connector, built on OpenTelemetry, enables the collection of Kafka messages and forwards ...