
Adding and configuring inputs
You can add, delete, and modify inputs using the visual editor. To add an input, click the Add Input icon () and select the input you want to add.
When you add inputs using the visual editor, their layout configuration is automatically generated in the dashboard definition. When you create an input in the source editor, you must add it in two places in the dashboard definition. You define the input stanza, with all of its options, in the inputs
section. If you define the input ID, it must begin with input_
. You must also list the unique ID of the input in the globalInupts
area of the layout
section. The order that the inputs are listed in the dashboard is the order they will be listed in the layout.
For example, in the code snippet below input_2
will be to the right of input_1
.
{ "inputs": { "input_1": { "type": "input.timerange", "title": "Select Time", "options": { "defaultValue": "-5m, now", "token": "trp" } }, "input_2": { "type": "input.dropdown", "options": { "items": [ { "label": "All", "value": "*" } ], "token": "dd1", "defaultValue": "*" }, "encoding": { "label": "primary[0]", "value": "primary[0]" }, "dataSources": { "primary": "search1" }, "title": "Select User" } }, "layout": { "type": "absolute", "options": {}, "structure": [], "globalInputs": [ "input_1", "input_2" ] }, "dataSources": { "search1": { "type": "ds.search", "options": { "query": "index=_internal \n| stats count by user", "queryParameters": { "latest": "$trp.latest$", "earliest": "$trp.earliest$" } }, "name": "User" } }, "visualizations": {}, "description": "", "title": "Super Input Dash" }
You define inputs by their type. For example, a dropdown input is of type input.dropdown
. You can set properties for their title and define options that depend on the input type. For example, two common options are token
and defaultValue
.
The following input types are supported:
input.timerange
A version of this input is automatically added to every dashboard by default and is applied to all data sources except those of type ds.savedSearch
. This input can be deleted or edited to set search intervals for individual data sources or global defaults. You can also add your own custom time range picker. For more information, see input.timerange
input.dropdown
input.multiselect
input.text
input.number
Add a submit button
You can add a submit button for users to click on to refresh a dashboard after making input selections. You add this property, submitButton
, in the layout section of the dashboard definition as an option. The settings are the boolean values true
and false
. When set to true
, a user must click a Submit button for an input selection to take effect. If set to false
, or if not specified at all, the dashboard will immediately refresh when a user makes a selection. The following layout example shows where to specify Submit button settings:
{ "layout": { "globalInputs": [], "type": "absolute", "options": { "submitButton": true, "display": "auto-scale" }, "structure": [] } }
Input configuration options available in the visual editor
Using the visual editor, you can add, delete, and move inputs along the top of the dashboard canvas.
The following table lists the configuration options available to you for each input in the UI.
Input configuration options
The settings for the options
field available to you will vary depending on the input type. For certain inputs like dropdown and multiselect you can use static values, dynamic values, or a combination of both. The following is a table of settings, options, and option settings for inputs. Settings are not options, but are values set at the same level as the options
field.
name | setting or option | description |
---|---|---|
token | option | Assign tokens values or options created by a connected data source query. |
defaultValue | option | The default value of the input on dashboard load. This will remain the value until changed by the user. |
items | option | Set static label/value pairs for users to select in input menus. |
min | option | Set the minimum number a user can select for input.number .
|
max | option | Set the maximum number a user can select for input.number .
|
step | option | Set the interval for the up and down arrows when a user clicks them for input.number .
|
clearDefaultOnSelection | option | When set to false the defaultValue remains selected when a user selects other options for input.multiselect . The default is true .
|
type | setting | The type of input. For example input.multiselect , input.text .
|
title | setting | Title of the input that will be displayed in edit & view mode. |
PREVIOUS Time range |
NEXT Setting tokens on a visualization click |
This documentation applies to the following versions of Splunk Cloud Platform™: 8.2.2201 (latest FedRAMP release), 8.2.2202, 8.2.2203
Feedback submitted, thanks!