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!

Improve Your Security Posture

Watch NowImprove Your Security PostureCustomers are at the center of everything we do at Splunk and security ...

Maximize the Value from Microsoft Defender with Splunk

 Watch NowJoin Splunk and Sens Consulting for this Security Edition Tech TalkWho should attend:  Security ...

This Week's Community Digest - Splunk Community Happenings [6.27.22]

Get the latest news and updates from the Splunk Community here! News From Splunk Answers ✍️ Splunk Answers is ...