Splunk® Enterprise

Developing Views and Apps for Splunk Web

Acrobat logo Download manual as PDF

Splunk Enterprise version 6.x is no longer supported as of October 23, 2019. See the Splunk Software Support Policy for details. For information about upgrading to a supported version, see How to upgrade Splunk Enterprise.
This documentation does not apply to the most recent version of Splunk. Click here for the latest version.
Acrobat logo Download topic as PDF

Setup screen example in setup.xml

The following example illustrates a setup screen for an app, MySampleApp.

MySampleApp contains three saved searches and a scripted input. In the setup screen, the user specifies the following configurations:

  • Interval for running the scripted input
  • Enable or disable the Web Search
  • The cron schedule for each of the searches
  • The earliest dispatch time for all the searches.

This setup screen modifies savedsearches.conf and inputs.conf.

Sample setup screen

In this example:

  • The configuration files already exist in $SPLUNK_HOME/etc/apps/MySampleApp/default/.
  • The configuration file contains the stanzas you are modifying.
  • The values present in the stanza represent the default values displayed by the setup screen.
  • If the user changes the default settings to a configuration file from the setup screen, Splunk software writes the updates to the configuration file in $SPLUNK_HOME/etc/apps/MySampleApp/local/.

The setup screen uses the following REST endpoints to update the configuration:


Configuration files for the example

Here are the default configuration files:


[Web Search]
search = sourcetype=access_combined ( 404 OR 500 OR 503 )
dispatch.earliest_time = -1d
cron_schedule = */5 * * * *
enableSched = 1

[Firewall Data Search]
search = sourcetype=cisco_wsa .exe usage!="Unknown"
dispatch.earliest_time = -1d
cron_schedule = */5 * * * *
enableSched = 0

[Email Data Search]
search = sourcetype=cisco_esa OUTBREAK_*
dispatch.earliest_time = -1d
cron_schedule = */5 * * * *
enableSched = 0


interval = 60
sourcetype = customsourcetype
source = customsource


Here is the setup.xml file that implements the setup screen. Note the following in the setup.xml file:

  • The entity specifying the path to scripted input uses URI encoding
  • The field for the Web Search uses the REST endpoint, is_scheduled. This updates the enableSched field in the [Web Search] stanza.
  • The text blocks use HTML entities to specify italic and bold for the type.
  • In the block that configures the cron schedule, entity specifies the regex '*' to specify all searches. The block contain examples for specifying iteration mode and bulk mode
  • See "setup.xml syntax" on Step 7: configure a setup screen for details on the syntax used in the example



  <!-- Note that the path to the script uses URI encoding -->	
  <block title="Enable a scripted input"
      &lt;i&gt;Specify the configuration for a single setting in a stanza.&lt;/i&gt;

    <input field="interval">
      <label>Specify the interval for [$name$] </label>

  <block title="Enable the schedule for a search"
         endpoint="saved/searches" entity="Web Search">
      &lt;i&gt;Specify the configuration for a single setting in a stanza.&lt;/i&gt;

    <!-- The field "is_scheduled" maps to the enableSched setting in savedsearches.conf -->		
    <input field="is_scheduled">
      <label>Enable Schedule for $name$</label>

<block title="Configure Cron Schedule" 
       endpoint="saved/searches" entity="*" mode="iter">
      &lt;i&gt;&lt;b&gt;Iteration mode&lt;/b&gt;:
      specify the cron schedule for each search in the conf file.&lt;/i&gt;</text>
    <input field="cron_schedule">
  <!-- an example of bulk change - enable all searches -->
  <block title="Set earliest dispatch time" 
         endpoint="saved/searches" entity="*" mode="bulk">
      &lt;i&gt;&lt;b&gt;Bulk mode&lt;/b&gt;: enable the earliest dispatch time for each search in the conf file.&lt;/i&gt;
    <input field="dispatch.earliest_time">
      <label>Set earliest dispatch time for all searches</label>

Last modified on 18 August, 2016
About files and directories for apps and add-ons
Setup screen example using a custom endpoint

This documentation applies to the following versions of Splunk® Enterprise: 6.3.0, 6.3.1, 6.3.2, 6.3.3, 6.3.4, 6.3.5, 6.3.6, 6.3.7, 6.3.8, 6.3.9, 6.3.10, 6.3.11, 6.3.12, 6.3.13, 6.3.14, 6.4.0, 6.4.1, 6.4.2, 6.4.3, 6.4.4, 6.4.5, 6.4.6, 6.4.7, 6.4.8, 6.4.9, 6.4.10, 6.4.11

Was this documentation topic helpful?

You must be logged into splunk.com in order to post comments. Log in now.

Please try to keep this discussion focused on the content covered in this documentation topic. If you have a more general question about Splunk functionality or are experiencing a difficulty with Splunk, consider posting a question to Splunkbase Answers.

0 out of 1000 Characters