Import and export an add-on project
Each add-on you create in the Splunk Add-on Builder has a corresponding project that contains the configuration settings. You must have access to this project in order to modify certain parts of your add-on, including data inputs or field extractions.
Export the add-on project as a TGZ file in order to import the project file to a different instance of Splunk Enterprise running Add-on Builder. This lets you share your add-on project or modify your add-on using a different computer than the one you used to develop the add on. You can only import and export projects for add-ons that were created in Splunk Add-on Builder.
As a best practice, export frequently to secure your work.
There are two ways to import and export add-on project: Splunk Web or a migration tool provided by the Splunk Add-on Builder.
- Splunk Web provides a simple process and the recommended path for migrating most add-ons. The exported file is gzipped.
- The migration tool provided by Splunk Add-on Builder lets you automate the process or for code repository check-in. The exported file is an extracted folder.
Import an add-on project using Splunk Web
- On the Splunk Add-on Builder home page on the Created with Add-on Builder tab, click Import Project.
- Navigate to the add-on TGZ project file and click Open.
Export an add-on project using Splunk Web
- Open the Splunk Add-on Builder home page on the Created with Add-on Builder tab.
- select the add-on and click Export.
Import or export a project using the migration tool
Run the shell command migration tool project_migration_tool
under $SPLUNK_HOME$/etc/apps/splunk_app_addon-builder/bin/aob/aob_tools
.
Arguments:
-h, --help Show the help of the migration tool and then exit -l,--log_level {DEBUG,INFO,WARNING,ERROR} Log level of the migration tool. Default:INFO -o, --output_dir The output directory to export the project to. -t, --ta_name The project name of which you want to import/export. -u, --user Splunk user name. Default:admin -p, --password Splunk password. Default:changeme -s, --splunk_web Splunk platform URL. Default: http://localhost:8000 -a, --action {export,import} The operation you want to do. Default:export -i, --input_directory The source directory of the project. -v, --version Show the version of the migration tool.
Example One
- Import the ServiceNow add-on on github to Splunk add-on builder under
$YOUR_FOLDER/ta_servicenow
. - Run the following command of the migration tool:
./project_migration_tool -a import -i $YOUR_FOLDER/ta_servicenow/TA-ServiceNow -s http://localhost:8000 -u admin -p changeme
Example two
Export the ServiceNow add-on on your local Splunk instance to github.
- Run the following command:
./project_migration_tool -a export -t TA-ServiceNow -o /tmp/ta_servicenow/ -s http://localhost:8000 -u admin -p changeme
- Copy the exported content to git repo directory.
cp -r /tmp/ta_servicenow/TA-ServiceNow/* $YOUR_FOLDER/ta_servicenow/TA-ServiceNow
- Check in the changes.
Design your add-on | Create an add-on |
This documentation applies to the following versions of Splunk® Add-on Builder: 4.1.1, 4.1.2, 4.1.3
Feedback submitted, thanks!