In Splunk Web, if you click on Apps, you should see a link for Manage Apps. From there, Splunk web will display the Apps page where you can see all of the apps currently installed in your Splunk instance.
From this page (sometimes referred to as “the manager”), you can enable or disable an app, set permissions, edit or change properties, and view (the apps) properties.
One more thing you may notice is an “Action” named “Set up” (not all apps have this). If the app does offer this link, you can use it to reset the apps default properties (whatever properties are configurable for that app). So what that means is you don’t have to edit Splunk’s configuration files to change the apps properties (pretty helpful, I think).
So, as a Splunk app developer, it would be nice if apps you develop include a setup screen. So – how do you do that? Well…
It’s easy to create an app setup screen for your app:
- Create a setup.xml file and “drop” it into your app’s default directory:
$SPLUNK_HOME/etc/apps/<AppName>/default/setup.xml.
- Edit that (setup.xml) file to provide values for the fields in your apps configuration files (note the setup screen will use these values to populate the input fields in the setup screen).
So here is a simple illustration.
My custom Splunk app is set up to do some very “extreme” searching on TM1 logs generated by my organizations Cognos TM1 Server (I’ve named it “Extremely Searchable”).
To create s simple setup screen for this app I created the following setup.xml (using Windows notepad) and copied it into
$SPLUNK_HOME/etc/apps/extreme/setup.xml.
A little explanation: I used 3 “blocks”. The first provided a title and description, the second provides an on/off checkbox to set the “check_for_updates” field for my app and the third gives two input text boxes to add a new “app user” username and password. (If you fill this screen out and click Save, Splunk will update the appropriate configurations for you).
No Splunk restart is required. So back into Splunk Web, from Apps, Manage Apps, I clicked on Set up and my setup screen is displayed:
XML
If you are somewhat familiar with basic XML, then creating a Splunk app setup.xml will be easy. The general format observes XML conventions and the following are the XML tags you’ll use:
<setup> This is the file “base element” for your setup screen.
<block> The block element defines the UI for the app setup screen.
<text> This is an optional element that provides descriptive text for the app setup screen.
<input> The input element collects input from the user.
<label> The label is the description of the input field which is displayed on the setup screen.
<type> This specifies the UI control for capturing user input. Allowed values for the type element are bool, text, password and list).
Adding a setup to your apps makes them more suitable for sharing with the Splunk community and it doesn’t require hours of extra effort. do it!