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!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...