Getting Data In

Hostname changing on some sources

Jaci
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

gkanapathy
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

gkanapathy
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.

0 Karma

Jaci
Splunk Employee
Splunk Employee

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

0 Karma

gkanapathy
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

gkanapathy
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

hulahoop
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
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!

Unlocking Unified Insights: New Gigamon Federated Search App for Splunk

In today’s data-heavy environment, organizations are caught in a data distribution dilemma. As data volumes ...

GA: New Data Management App in Splunk Platform

Streamlining Data Management: Introducing a unified experience in Splunk Managing data at scale shouldn’t feel ...

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 ...