Choose your Splunk Enterprise upgrade path for the Python 3 migration
Splunk Enterprise administrators must plan the upgrade to Splunk Enterprise version 8.1 to account for the additional steps required due to the Python 2.7 end of life.
This page applies only to Splunk Enterprise. If you are a Splunk Cloud administrator, work with Splunk Support to plan your upgrade.
In Splunk Enterprise version 8.1, Splunk Enterprise uses the Python 3 interpreter globally by default. You can choose to revert to Python 2, but Splunk Web supports only Python 3.7. Scripts and templates that depend on Splunk Web must be adjusted to use Python 3-compatible syntax before the upgrade, but you have options for how and when you adjust Python scripts that aren't dependent on Splunk Web.
For these files that aren't dependent on Splunk Web, Splunk Enterprise 8.1 offers per-file Python version switches in the configuration files. In addition, a global switch allows you to modify the default Python version.
Depending on your organization's requirements, you might choose to upgrade to Python 3 as comprehensively as possible as you upgrade to version 8.1 of Splunk Enterprise, using dual-compatible Python code or by rewriting Python scripts to be compatible only with Python 3. Or, you might choose to upgrade to version 8.1 without immediately performing a full Python 3 migration, by changing the default Python version to Python 2 and only modifying your scripts and templates that depend on Splunk Web.
Use the following table to choose the upgrade path that is best for you. If you use private, in-house apps, you have more choices about the time and method by which you upgrade. If you use Splunkbase apps, you are constrained by the choices of the app developer regarding compatibility with Python 2 and Python 3.
If you chose to migrate to Python 3 when you upgraded to Spunk Enterprise 8.0, then you do not need to complete any additional tasks regarding the Python migration in order to upgrade to Splunk Enterprise 8.1.
|Statement that best describes you||Overall effort||Instructions|
|I want to use the default Python 3 runtime.||Recommended. Lowest overall effort.||Upgrade using the Python 3 runtime and dual-compatible Python syntax in custom scripts|
|I want to upgrade with minimal work, regardless of Python version.||Low effort in the short term,
high effort in the long term.
|Upgrade using the Python 2 runtime and make minimal changes to Python code|
If you aren't sure which statement best applies to you, the best practice is to Upgrade using the Python 3 runtime and dual-compatible Python syntax in custom scripts.
Migrate a Splunk Enterprise instance from one physical machine to another
Upgrade using the Python 3 runtime and dual-compatible Python syntax in custom scripts
This documentation applies to the following versions of Splunk® Enterprise: 8.1.0, 8.1.1