I'm keeping this: http://www.splunk.com/wiki/Deploying_Splunk_Light_Forwarders
up to date as the recommended way to deploy. Please refer to that link, since as Splunk versions change and we develop new practices, I'll maintain the other link.
Note the the below applies to 4.0. For 4.1, the script is valid, but the configuration file set required is smaller, as 4.1 does not set as much upon install, and therefore does not need as much to disable functionality. In particular, you will not need:
etc\apps\search\local\inputs.conf
etc\apps\search\local\savedsearches.conf
etc\apps\SplunkLightForwarder\local\inputs.conf
etc\apps\windows\local\inputs.conf
etc\apps\windows\local\savedsearches.conf
but you will still want to have:
etc\apps\sample_app\local\app.conf
etc\apps\SplunkLightForwarder\local\app.conf
etc\apps\deploymentclient\local\deploymentclient.conf
You can use any software distribution mechanism you have available. To install Light Forwarders on Windows, I recommending creating a Windows batch file install.cmd containing:
setlocal
IF "%PROCESSOR_ARCHITECTURE%" == "AMD64" goto b64
IF "%PROCESSOR_ARCHITEW6432%" == "AMD64" goto b64
:b32
set SPLUNK_MSI=%~dp0\splunk-4.0.9-74233-x86-release.msi
REM set above to path to 32-bit version
goto endb6432
:b64
set SPLUNK_MSI=%~dp0\splunk-4.0.9-74233-x64-release.msi
REM set above to path to 64-bit version
:endb6432
if not defined ProgramFilesW6432 (
set LOC=%ProgramFiles%\Splunk
) else (
set LOC=%ProgramFilesW6432%\Splunk
)
rem the WINEVENLOG*CHECK settings don't do anything in 4.0. They're just carried over from 3.x where they make sure the inputs weren't enabled.
msiexec.exe /i "%SPLUNK_MSI%" INSTALLDIR="%LOC%" LAUNCHSPLUNK=0 WINEVENTLOGAPPCHECK=0 WINEVENTLOGSYSCHECK=0 WINEVENTLOGSECCHECK=0 SPLUNK_APP="" /QUIET
xcopy "%~dp0\etc" "%LOC%\etc" /s /f /y
copy /y "%LOC%\etc\splunk-forwarder.license" "%LOC%\etc\splunk.license"
pushd "%LOC%\bin\"
splunk restart --accept-license --no-prompt --answer-yes
popd
endlocal
Edit the Splunk MSI path information as appropriate, and place the MSI files in the same directory as this script. Finally, create a directory in the same folder called etc , and place all your initial Splunk configuration files there.
To create a bare initial installation that does nothing, with all defaults inputs and scripts disabled, place the following files into the etc directory. Other configurations are possible with different sets of configuration files:
etc\apps\sample_app\local\app.conf
etc\apps\search\local\inputs.conf
etc\apps\search\local\savedsearches.conf
etc\apps\SplunkLightForwarder\local\app.conf
etc\apps\SplunkLightForwarder\local\inputs.conf
etc\apps\windows\local\inputs.conf
etc\apps\windows\local\savedsearches.conf
etc\apps\deploymentclient\local\deploymentclient.conf
The files should contain:
etc\apps\sample_app\local\app.conf:
[install]
state = disabled
etc\apps\search\local\inputs.conf:
[script://$SPLUNK_HOME\bin\scripts\splunk-wmi.py]
disabled = true
[script://$SPLUNK_HOME\bin\scripts\splunk-regmon.py]
disabled = true
etc\apps\search\local\savedsearches.conf:
[Top five sourcetypes]
enableSched = false
[Indexing workload]
enableSched = false
etc\apps\SplunkLightForwarder\local\app.conf:
[install]
state = enabled
etc\apps\SplunkLightForwarder\local\inputs.conf:
[monitor://$SPLUNK_HOME\var\log\splunk]
disabled = true
etc\apps\windows\local\inputs.conf:
[WinEventLog:Application]
disabled = true
[WinEventLog:Security]
disabled = true
[WinEventLog:System]
disabled = true
[script://$SPLUNK_HOME\bin\scripts\splunk-admon.py]
disabled = true
[monitor://$WINDIR\WindowsUpdate.log]
disabled = true
etc\apps\windows\local\savedsearches.conf:
[CPU Utilization Summary]
enableSched = 0
[CPU Utilization by Threshold]
enableSched = 0
[Top Processes by Memory]
enableSched = 0
[Top Processes by CPU]
enableSched = 0
[Disk Utilization]
enableSched = 0
[win_eventlog_count_sum_index]
enableSched = 0
[performance_snapshot]
enableSched = 0
and finally, etc\apps\deploymentclient\local\deploymentclient.conf is only necessary if you will be using the Splunk Deployment Server to manage the forwarder configurations. Unless you have another configuration management system, we recommend you use the Deployment Server to be able to make modifications to forwarder configurations from. However, any system which lets you push configurations files and restart a service can be used instead, e.g., on Linux systems, puppet has been a good and effective solution that can both install Splunk and manage the configuration.
[deployment-client]
[target-broker:deploymentServer]
targetUri = mydeploymentserverhostname:8089
... View more