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.

Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Calling All Security Pros: Ready to Race Through Boston?

Hey Splunkers, .conf25 is heading to Boston and we’re kicking things off with something bold, competitive, and ...

Beyond Detection: How Splunk and Cisco Integrated Security Platforms Transform ...

Financial services organizations face an impossible equation: maintain 99.9% uptime for mission-critical ...

Customer success is front and center at .conf25

Hi Splunkers, If you are not able to be at .conf25 in person, you can still learn about all the latest news ...