In this chapter, we will cover how to properly package our 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, both created by 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 "T"s and dot your "I"s before you upload. As we progress through this chapter, we will package our App and get it ready for deployment on Splunkbase. We will first go over the naming guidelines, and then cover some standards and best practices. Once we've detailed what needs to happen, we will see how to actually package the...
You're reading from Splunk Developer's Guide
Splunk has provided a very nice set of guidelines for use in packaging your App. These guidelines are important, as you would not want to infringe on any copyrights or licensed trademarks as you build your App.
Tip
These are Guidelines, and while your App can literally be named anything you want for use, either internally to a company or for an individual installation, you must follow the guidelines for publishing 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 the 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...
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 in 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, you can start 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, as they...
The App packaging 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 on intellectual property. Make sure that 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 configurations and how to finalize the package, making it ready for publishing.
We also went through a list of do's and don'ts for things within an App, and provided an App checklist as a reminder of what is required and what you need to make sure is present in 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 on Splunkbase, as well as some other areas where you can receive support from the Splunk community.