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!

Thanks for the Memories: .conf26 Took Learning to New Heights

Thank you, Splunk Community, for making .conf26 in Denver one for the books. From packed Splunk University ...

Best Practices: Splunk auto adjust pipeline queue

When you enable autoAdjustQueue in Splunk, maxSize should be understood as the queue size Splunk starts with ...

Splunk Auto Ingestion Parallel Pipeline Scaling

Why this feature matters Many Splunk environments experience ingestion pressure long before the host is fully ...