All Apps and Add-ons

Writing an app that will require REST API Modular Input as a dependency, what is the best method of incorporating this into the app?

mwalker_splunk
Splunk Employee
Splunk Employee

I'm in the process of writing an app that will require the REST API Modular input as a dependency, including at least one custom response handler class. What is the best method of incorporating this into the app?

0 Karma

jbjerke_splunk
Splunk Employee
Splunk Employee

Hi mwalker

This topic is quite lengthy and different approaches might be suitable depending on the complexity of the app dependencies.

Splunk wrote a whole article about this topic as part of the PAS reference app:
http://dev.splunk.com/view/dev-guide/SP-CAAAE26

There are basically four approaches:

Creating an installer inside a Splunk app
Taking this approach, we could package all the dependencies inside the main app and include logic that installs them as and when they are required. The Splunk App for VMware plans to use this approach in the future.
A variation on this approach is to have a dedicated installer app that sets up the main app and all of its dependencies, and then redirects requests to the main app it installed. The Splunk App for Enterprise Security uses this approach.

Using an external installer
Using this approach, we could create a script that automatically installs an app and its dependencies. Alternatively, we could use a third-party installer tool to build the installation scripts.

Ask the customer to install the app and its dependencies manually from a single ZIP file
Taking this approach, we could package the main app and all the add-on apps in a single ZIP archive. We would then ask the customer to unpack the archive into the etc/apps/ folder. The Splunk App for VMware currently uses this approach.

Ask the customer to install the main app and each dependent add-on individually
Taking this approach, we would add detailed installation instructions to the documentation explaining how the customer should obtain and install each of the apps individually. Optionally, we could add logic to the main app that detects missing dependencies and then prompts the customer to install them. The Splunk App for Microsoft Exchange uses this approach.

Let me know how you get along.

j

mwalker_splunk
Splunk Employee
Splunk Employee

Thank you for the details, I plan to incorporate one of these strategies in my app. As far as the custom response handler class is concerned, since the documentation says to add the class to rest_ta/bin/responsehandlers.py, is there a way to include an additional file from my app? or programmatically add my code to the rest_ta after it is installed?

0 Karma
Get Updates on the Splunk Community!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...