How-To's

The Splunk App Framework How-To's below draw upon real world Splunk app and add-on components to better explain their compositions and interactions with other parts of the app framework. Treat them as the de facto design and implementation guides you when you are building components for your own app or add-on. Don't forget to read over the Packaging How-To to ensure that your app, add-on, or module is prepared for redistribution.

These How-To's assume that you have a working knowledge of Splunk and the Splunk App Framework, perhaps from reading through the Overview section of this documentation, as well as a general familiarity with Python, HTML, and JavaScript.

If you are looking for a comprehensive walk through of an entire Splunk add-on, app, or module, check out the Tutorials section within this documentation, which draws on several of the articles below to better illustrate how an app or add-on is built.

General

This article includes information on module, app, and add-on packaging structure and requirements.

Controllers

Custom controllers are Python classes that are packaged within a Splunk app or add-on and manage interactions between the user and the model as part of the classic MVC design pattern.

JavaScript

Application JavaScript (aka application.js) is packaged within a Splunk app and is included in any Splunk view rendered within the app.

Custom JavaScript is most often included in custom templates served by custom controllers to provide additional control over user interactions in the browser.

Module JavaScript is packaged within a Splunk module and is included in any Splunk view that references the module, often in an implementation of the AJAX design pattern.

Templates

Custom templates are Mako templates that are packaged within a Splunk apps or add-ons and generate custom HTML depending on the template arguments provided by the custom controller rendering the template, often in implementations of the classic MVC design pattern.