Getting Data In

Hostname changing on some sources

Splunk Employee
Splunk Employee

In inputs.conf the default host name is set to the fqdn, test-server.foobar.com. But when I search for that host, it comes up as two hosts: test-server and test-server.foobar.com.

splunkd.log shows the correct hostname, test-server.foobar.com.

This started happening after an upgrade from 3.x to 4.x on light weight forwarders, although some LWFs are working correctly.

It seems to only happen for the cron log and not the other inputs, what could be causing this and what can I do to fix it?

Tags (1)
1 Solution

Splunk Employee
Splunk Employee

Some sourcetypes modify the hostname according to the contents of the file. This happens in particular for syslog sourcetypes. To stop it happening, use another sourcetype, or override the syslog host transform in props.conf with either:

[syslog]
TRANSFORMS = 

for most syslog sourcetypes, or

[postfix_syslog]
TRANSFORMS-host = 

for the postfix_syslog sourcetype. I don't know why that one had to be different.

View solution in original post

0 Karma

Splunk Employee
Splunk Employee

Some sourcetypes modify the hostname according to the contents of the file. This happens in particular for syslog sourcetypes. To stop it happening, use another sourcetype, or override the syslog host transform in props.conf with either:

[syslog]
TRANSFORMS = 

for most syslog sourcetypes, or

[postfix_syslog]
TRANSFORMS-host = 

for the postfix_syslog sourcetype. I don't know why that one had to be different.

View solution in original post

0 Karma

Splunk Employee
Splunk Employee

Thank you for the answer and comments....this info was very helpful!

0 Karma

Splunk Employee
Splunk Employee

(Or that not all the forwarders were Light Forwarders at the time of upgrade, and they become Light (again) when upgraded to 4.x and gained a default-mode.conf file.)

0 Karma

Splunk Employee
Splunk Employee

setting host= as a global setting will use that unless host is set otherwise in a another input stanza, but this is a different issue and is caused by default TRANSFORMS that will ignore/overrride whatever you set host= to in inputs.conf. I have a suspicion that not all the Forwarders are Light Forwarders.

0 Karma

Splunk Employee
Splunk Employee

Gerald, can you confirm--setting host=foo as a global parameter in inputs.conf does not make it a global setting. It is simply the default setting when nothing else sets the host field? So it looks like this behavior changed between 3.x and 4.x?

0 Karma
State of Splunk Careers

Access the Splunk Careers Report to see real data that shows how Splunk mastery increases your value and job satisfaction.

Find out what your skills are worth!