How to package your app
This documentation does not apply to the most recent version of Splunk. Click here for the latest version.
How to package your app
You can distribute your app on Splunkbase, which will make it available to everyone in the Splunk community. Before you run the packaging script within Splunk, please read through the best practices on this page.
Best practices
Before you publish your app on Splunkbase, it's a good idea to make sure you have the following:
- An app.conf file filled out with author and description. Read more about how to app.conf in this manual.
- A screenshot.png and appicon.png in the app's appserver/static directory.
- Include a README.txt with instructions on installing and configuring your app, as well as any hints for troubleshooting.
- Use environment variables to set locations in any scripts within your app so that they only have to be set once, and make sure you include this information in your README.txt.
- If your app includes scripted inputs, provide instructions to test the script outside of Splunk.
- If your app is intended to run cross-platform, include both sh and bat files for scripted inputs and include an inputs.conf that can enable either one
- Include any other dependencies your app needs to run outside of your environment. You may want to test it on a different system to make sure it works out of the box.
Use the Appbuilder script
If you are using the Appbuilder script, app configurations can either be in default or local; the script will combine your configurations into the default directory upon packaging.
From the Splunk command line, enter:
./splunk package app <app_name>
For example:
./splunk package app customer_experience
Use your own method
You can use your OS specific tar/gzip application of choice, just make sure that whatever application you use allows both tar and gzip. You want to end up with a .tgz file that you'll rename as .spl.
Before you zip and tar up your app, take all the components you've configured and make sure they are in your app's default directory in $SPLUNK_HOME/etc/apps/<your_app>/default/.
Then, tar and gzip the app. Make sure you rename the extension from .tgz to .spl.
On Unix/Mac OS, you can run the following command from the commandline:
tar -czf <app_name>.spl app_dir/
Then you’ll get an spl file (just a tgz but with a special suffix).
This documentation applies to the following versions of Splunk: 4.0 , 4.0.1 , 4.0.2 , 4.0.3 , 4.0.4 , 4.0.5 , 4.0.6 , 4.0.7 , 4.0.8 , 4.0.9 , 4.0.10 , 4.0.11 View the Article History for its revisions.