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!

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...

What's new in Splunk Cloud Platform 9.1.2312?

Hi Splunky people! We are excited to share the newest updates in Splunk Cloud Platform 9.1.2312! Analysts can ...

What’s New in Splunk Security Essentials 3.8.0?

Splunk Security Essentials (SSE) is an app that can amplify the power of your existing Splunk Cloud Platform, ...