Splunk® Enterprise

Splunk Dashboard Studio

Acrobat logo Download manual as PDF


Acrobat logo Download topic as PDF

Adding and configuring inputs

You can add, delete, and modify inputs using the visual editor. To add an input, click the Add Input icon (The Add Input icon.) and select the input you want to add.

An image of the Add Inputs drop down menu.

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 so the dashboard does not refresh until the user has selected all input choices. However, if you add a submit button, searches will not run until a user interacts with the submit button, even if the inputs have default values.

To have the dashboard load using the default input values, add the option submitOnDashboardLoad, which will automatically run searches on the first dashboard load. After the initial load, the user must select the submit button to refresh the dashboard's searches and visualizations.

You add submitOnDashboardLoad and submitButton in the layout section of the dashboard definition as options. 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. If you don't add submitButton then submitOnDashboardLoad will not work.

The following layout example shows where to add submitOnDashboardLoad and submitButton settings:

{
	"layout": {
		"globalInputs": [],
		"type": "absolute",
		"options": {
			"submitButton": true,
			"submitonDashboardLoad": 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.

name configuration option example image
Time range picker title, token, defaultValue Time range picker UI options.
Number title, token, defaultValue,min, max, step Number input UI options.
Text title, token, defaultValue Text input UI options.
Dropdown title, token, defaultValue

You can also set static label/value pairs for the input.

Dropdown input UI options.
Multiselect title, token, defaultValue

You can also set static label/value pairs for the input.

Multiselect input UI options.

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.
Last modified on 23 August, 2022
PREVIOUS
Time range
  NEXT
Setting tokens on a visualization click

This documentation applies to the following versions of Splunk® Enterprise: 9.0.0, 9.0.1


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