In this chapter, we will cover how to properly package your App for publishing. Packaging your App correctly is critical to allowing you to publish the App on Splunkbase. Splunk provides a set of guidelines and standards that must be met for your App to be included on Splunkbase. Splunkbase is the official repository for Splunk Apps and add-ons, created by both Splunk and other contributors. Packaging also gives you the opportunity to brand and document your App in a manner that clearly defines you and your brand. Splunkbase automatically checks the structure of your App when you upload it, so it is important to make sure you cross your Ts and dot your Is before you upload. As we progress through this chapter, we will package our App and get it ready for deployment to Splunkbase. We will first go over the naming guidelines, and then cover some standards and best practices. Once we detail what needs to happen, we will see how to actually package the App.
You're reading from Splunk Developer's Guide - Second Edition
Splunk has provided a very nice set of guidelines for use in packaging your App. These guidelines are important, as you do not want to infringe on any copyrights or licensed trademarks as you build your App.
Note
These are guidelines, and while your App can literally be named anything you want for use, either internally in a company or for an individual install, you must follow the guidelines to publish on Splunkbase.
The first guideline revolves around using third-party trademarks. A third-party trademark is anything that you or Splunk do not own, control, or have license to use except under fair use. When using a third party trademark, Splunk maintains that you must separate the third party's trademark from the Splunk trademark with the word for, which:
Clarifies that the third-party trademark and associated technology do not belong to Splunk or the author of the App or add-on.
Indicates that the App or add-on works with a specific third-party product. You should include the...
Now we actually get to package the App in preparation for publishing. We will cover how to use both a *nix command line as well as 7-Zip for Windows. We will carry out the compression only after readying the folder structure for packaging. Let's start by copying the entire App folder to a new location. This makes sure that we get a clean directory to move files and content within. If you are using Git, you can also simply commit the dev changes and clone the repository into a different folder. This is beneficial, since earlier we had some build files in the appserver/static
folder, but they didn't make it into the repository. Keep it clean, and keep it small!
Once you have relocated your App, we can start with the actual packaging. The first thing to remove is the metadata/local.meta
file. The next thing is to check the default permissions in metadata/default.meta
. If they look good, let's move on to the bin
folder. This is where you would want to remove any *.pyc
files...
The App packing checklist table is a non-all-inclusive checklist for App packaging requirements. Not every item on this list needs to be in every App, but it should provide a basic reminder of what is required:
Basic checklist | ||
---|---|---|
Basic README file |
XML is well formed |
Empty |
Contact information |
App description |
Delete metadata/ |
Clean of viruses/malware |
App ID |
Verify default permissions |
No malicious commands |
App version |
Remove dynamic lookups |
Executables located in |
App icon |
No hardcoded paths |
SPL file format |
Common Information Model compliance |
Setup screen |
App name complies with guidelines |
Valid EULA |
No hardcoded index paths |
In this chapter, we covered the Splunk guidelines for naming conventions. Naming your App incorrectly could cause an infringement of intellectual property. Make sure you use third-party trademarks properly, following both Splunk's and the third party's guidelines. We covered the basic options needed for the app.conf
file, and went through the standards for content located within the App. We saw how to combine the configurations and how to finalize the package, making it ready for publishing.
We went through a list of dos and don'ts of things to do within an App, and provided an App checklist as a reminder of what is required and what you need to make sure is presented within the App. While these lists are not exhaustive, they provide a basic measure to test your Apps against.
In our final chapter, we will cover how to publish the App to Splunkbase, as well as some other areas where you can receive support from the Splunk community.