In our environment, we are planning to push a splunkforwarder to a Windows server. Part of that, we are copying deploymentclient.conf file to each and every machine.
My requirement is,
In deploymentclient.conf, there is a entry for clientname=<hostname>.
How can we use a variable to mention the hostname of the machine for clientname entry.
clientname = $HOSTAME under the deployment-client stanza is all you need to do.
When you install splunk it will automagically grab the hostname of the host you are installing splunk on. We use a silent install script that simply installs the splunk forwarder and points the host to the deployment server. The script looks like this:
msiexec.exe /i splunkforwarder-6.2.4-271043-x64-release.msi DEPLOYMENT_SERVER="hostname:8089" AGREETOLICENSE=Yes /quiet
Again it will automatically use the hostname that was assigned to the machine.
Hope that helps!