Deployment Architecture

Good practice to remove serverName from server.conf?

satyenshah
Path Finder

I'm wondering what are the consequences of deleting the "serverName" attribute from server.conf in /etc/system/local. We'd like to do that because sometimes servers get cloned by other teams in our organization (oblivious to splunk clone-prep-clear-config, and the cloned server gets deployed. Both servers send logs to Splunk Enterprise containing the same hostname. That needs to be detected and remediated. A preventative solution seems to be removing serverName from all forwarders using a deployment-app.

From testing on Windows/RHEL, Splunk works fine falling back to /etc/system/default, which contains serverName=$COMPUTERNAME, which sets the hostname at runtime. That makes it peculiar that serverName is hardcoded in /etc/system/local at installation. Is there a reason for that, or is it legacy from earlier versions of Splunk?

Two questions:

1) are there any unintended consequences of removing serverName from /etc/system/local?
2) would it be better to remove serverName from /etc/system/local, or to replace it with $COMPUTERNAME?

1 Solution

richgalloway
SplunkTrust
SplunkTrust

$COMPUTERNAME is a good default setting, but sometimes you want your forwarder to have a more descriptive name, hence the setting in etc/system/local.

1) Splunk doesn't care which setting you use so the consequences are purely in how you use your server/forwarder names.
2) Either. The trouble is you can't override etc/system/local with etc/apps/myapp/. You would have to do it with something other than the deployment server, like Puppet of Ansible.

---
If this reply helps you, Karma would be appreciated.

View solution in original post

0 Karma

xanthakita
Path Finder

Have you considered using host=someUniqueHostname in your inputs.conf file... which you can manage from a deployment server?

its possible that the _internal indexes will continue to show the servername attribute, however your regular indexed events will show from whatever name you put in inputs as host=...

I often use different host names from the same UF if I am getting logs from multiple servers forwarded to one UF for example.

0 Karma

richgalloway
SplunkTrust
SplunkTrust

$COMPUTERNAME is a good default setting, but sometimes you want your forwarder to have a more descriptive name, hence the setting in etc/system/local.

1) Splunk doesn't care which setting you use so the consequences are purely in how you use your server/forwarder names.
2) Either. The trouble is you can't override etc/system/local with etc/apps/myapp/. You would have to do it with something other than the deployment server, like Puppet of Ansible.

---
If this reply helps you, Karma would be appreciated.
0 Karma

satyenshah
Path Finder

Thanks! Concerning the method, I already have a deployment app that comments out the line in server.conf. The question was mistakenly edited by the admins suggesting that I was asking how to remove the serverName, as opposed to whether removing the serverName is the best approach.

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!

SOC4Kafka - New Kafka Connector Powered by OpenTelemetry

The new SOC4Kafka connector, built on OpenTelemetry, enables the collection of Kafka messages and forwards ...

Event Series: Level up your SOC: Advancing with Splunk Enterprise Security

AI has fundamentally raised the stakes for security operations, and this three-part series is your guide to ...

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