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
Get Updates on the Splunk Community!

Leveraging Detections from the Splunk Threat Research Team & Cisco Talos

  Now On Demand  Stay ahead of today’s evolving threats with the combined power of the Splunk Threat Research ...

New in Splunk Observability Cloud: Automated Archiving for Unused Metrics

Automated Archival is a new capability within Metrics Management; which is a robust usage & cost optimization ...

Calling All Security Pros: Ready to Race Through Boston?

Hey Splunkers, .conf25 is heading to Boston and we’re kicking things off with something bold, competitive, and ...