Getting Started with the App Framework

Environment setup

Developing custom applications using the App Framework requires little more effort than installing Splunk. After that, you can use your favorite Web development tools to create and debug your application.

About the Splunk installation

To develop, test and execute custom apps and add-ons, you need is to have Splunk installed. There are no special installation requirements for app development so, if this is your first exposure to Splunk, refer to the Installation Manual.

You'll find the following Installation Manual sections most relevant:

Where to find the code

After Splunk is installed, you'll have access to the App Framework API source files, including application hooks into the framework. For Linux, most of the source files you'll find useful are in the following locations, where Python2.x is the version of your Splunk Python distribution:

Python controllers $SPLUNK_HOME/lib/Python2.x/site-packages/splunk/appserver/mrsparkle/controllers
Python libraries $SPLUNK_HOME/lib/Python2.x/site-packages/splunk/appserver/mrsparkle/lib
Python model $SPLUNK_HOME/lib/Python2.x/site-packages/splunk/models
Javascript libraries/utilities $SPLUNK_HOME/share/splunk/search_mrsparkle/exposed/js
Javascript module base classes $SPLUNK_HOME/share/splunk/search_mrsparkle/modules

Your custom app, like all applications, resides in: $SPLUNK_HOME/etc/apps/<yourAppName>.

See Example source code for the example application code used in this document.

Your programming environment

Creating source files

For whichever hardware platform or operating system you use to develop software, you can use your favorite text editor, or IDE for a more formally managed project.

Debugging your application

Most debugging involves viewing your HTML/CSS/JavaScript, and you'll find that browser plugins, such as FireBug, are useful tools.

To debug Python, server-side, code, we recommend becoming familiar with Splunk logging facilities. Log files useful in determining environment setup and application problems, particularly web_service.log are located in the $SPLUNK_HOME/var/log/splunk directory.