Getting Data In

host value for windows

cmeo
Contributor

I've seen a few postings on this topic, but there doesn't seem to be final solution. I'm getting up to four different styles of host name from my windows boxes:

  1. COMPUTER NAME (all upper case, not fqdn)
  2. computer name (all lower case, not fqdn)
  3. computer.domain.com.au (the value I actually want, canonical DNS fqdn)
  4. computer.windows-domain.com.au (derived from AD info if present)

This is annoying, and I'd like to know if there is one spot where I can set option 3 such that it will override all the others. So far I haven't found it. Furthermore it would great if splunk installation prompted for this, so you don't have to find and edit the files.

Tags (1)

cmeo
Contributor

Figured out how to do it with yet another ugly hack. You can get the host name part of the windows computer name, however it appears, with this:

eval x=split(host, ".") | eval w_host=mvindex(x,0)

This normalises your hostname if it does have the domain part, but still works if it doesn't.

You can then use this in a form to match your windows host however it appears:

sourcetype=wmi:cputime host=*$w_host$*

which normalises data sources which do not have the domain part, but still works if they do.

Nasty, should be unnecessary, but it works.

0 Karma

lguinn2
Legend

There is no single place that this can be set. If you want to set a consistent host format, the most direct way is to set it explicitly for each input. This can be a painful solution if you are using the deployment server and/or have many Windows forwarders.

You will also need to override TRANSFORMS = syslog-host Splunk automatically applies the syslog-host transformation to some of the sourcetypes that are syslog-based. To override it, you will need to add

TRANSFORMS=

to the appropriate sourcetype stanza of props.conf on all of the indexers. If you use "heavy" forwarders, you will also need to set it there as well.

You could submit this to Splunk Support as an enhancement request. (The more requests, the more likely that someone will add this as a feature in a future release...)

cmeo
Contributor

The silence has been deafening...

0 Karma

jdunlea_splunk
Splunk Employee
Splunk Employee

I am also finding this problem... Does anybody have any solution??

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!

Observability Simplified: Combining User Experience, Application Performance & ...

Tech Talk Observability Simplified: Combining User Experience, Application Performance & Network ...

Event Series May & June: From Network Visibility to Service Intelligence

Unifying the Network: Moving from Alert Noise to Service Intelligence with Splunk ITSI In today’s hybrid ...

Global Splunk User Group Events: May + June 2026

Your Splunk Community Awaits: Discover Upcoming User Group Events Worldwide    Staying ahead in the fast-paced ...