Installation

How can I install a splunk 4.2+ license from the command line?

jrodman
Splunk Employee
Splunk Employee

I have a license for my splunk 4.2 installation, and I want to install it without using the web interface, how can I do this?

Tags (3)
1 Solution

jrodman
Splunk Employee
Splunk Employee

As a preamble, in 4.2+ you may be using (optional) a license master where license data is handled in a central location, which case local license management is irrelevant. This information is still useful in such an environment for the license master location.

Firstly, there is a command

windows:

Splunk\bin\splunk.exe add license <license.file>

unix:

splunk/bin/splunk add license <license.file>

This will install the license in the appropriate location, and is probably the tool you should use.

However if you have specific needs to pre-populate a splunk installation for mass rollout or other scenarios, you can manually add your license file to the directory

$SPLUNK_HOME/etc/licenses

There are directories under etc/license for each category of license, which are automatically managed by the web and command line license addition methods. It is intended that a license in the top level etc/licenses will be moved to the right location automatically, but I probably wouldn't rely on this functionality as an automated production workflow. A license placed in the correct subdirectory location (eg $SPLUNK_HOME/etc/licenses/enterprise/) should work reliably.

As always, the license files present in the license directory are not as informative as asking splunk (via cli or manager) about the license it is actually using (files may be corrupt, splunk may not have been restarted. The command line to use is,

splunk list licenses

while in manager simply navigate to licenses.

View solution in original post

jrodman
Splunk Employee
Splunk Employee

As a preamble, in 4.2+ you may be using (optional) a license master where license data is handled in a central location, which case local license management is irrelevant. This information is still useful in such an environment for the license master location.

Firstly, there is a command

windows:

Splunk\bin\splunk.exe add license <license.file>

unix:

splunk/bin/splunk add license <license.file>

This will install the license in the appropriate location, and is probably the tool you should use.

However if you have specific needs to pre-populate a splunk installation for mass rollout or other scenarios, you can manually add your license file to the directory

$SPLUNK_HOME/etc/licenses

There are directories under etc/license for each category of license, which are automatically managed by the web and command line license addition methods. It is intended that a license in the top level etc/licenses will be moved to the right location automatically, but I probably wouldn't rely on this functionality as an automated production workflow. A license placed in the correct subdirectory location (eg $SPLUNK_HOME/etc/licenses/enterprise/) should work reliably.

As always, the license files present in the license directory are not as informative as asking splunk (via cli or manager) about the license it is actually using (files may be corrupt, splunk may not have been restarted. The command line to use is,

splunk list licenses

while in manager simply navigate to licenses.

Get Updates on the Splunk Community!

[Puzzles] Solve, Learn, Repeat: Dynamic formatting from XML events

This challenge was first posted on Slack #puzzles channelFor a previous puzzle, I needed a set of fixed-length ...

Enter the Agentic Era with Splunk AI Assistant for SPL 1.4

  &#x1f680; Your data just got a serious AI upgrade — are you ready? Say hello to the Agentic Era with the ...

Stronger Security with Federated Search for S3, GCP SQL & Australian Threat ...

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...