Set Splunk environment variables on Windows
You do not need to set Splunk environment variables to use the CLI on Windows. If you want to use variables to run CLI commands, you must set variables manually.
Set temporary variables on the command prompt
- Open a PowerShell window, or a command prompt.
- Use a Powershell variable or environment variable to set a quick reference path to Splunk Enterprise.
PowerShell Command prompt $splunk_home="C:\Program Files\Splunk"set SPLUNK_HOME="C:\Program Files\Splunk" - Call the variable when running Splunk Enterprise CLI commands.
PowerShell Command prompt & $splunk_home\bin\splunk status%SPLUNK_HOME%\bin\splunk status
Set permanent environment variables
To set a permanent variable, see Add or change environment variables on MS TechNet.