Add inputs and tokens to glass tables in ITSI
Inputs in the IT Service Intelligence (ITSI) glass table editor let you add dropdown, multiselect, text, numbers and time range for input menus. Your users can then leverage these menus to perform actions on the canvas and on visualizations, such as filtering a query or changing a visualization property. You can implement inputs using the glass table UI editor, or the source editor.
If using the source editor, specify each input you plan to use under the globalInputs
layout option in the glass table definition. Define each individual input in the inputs
section.
You can configure some inputs to associate values with tokens. Tokens act as variables that change when you select an input option. You can also use tokens as variables in searches and inputs, or as titles and descriptions in the glass table definition. For more information, see Add tokens to create dynamic glass tables.
Input types
The following input types are available in ITSI glass tables:
Setting | Description |
---|---|
input.dropdown
|
Add dropdown menus to your glass table. Can be backed by static values or the results of a search. |
input.multiselect
|
Add dropdown menus where users can select one or more options. Can be backed by static values or the results of a search. |
input.text
|
Let users choose titles, descriptions, and other forms of text entries. |
input.number
|
Let users enter numbers and control number values using step controls. |
input.timerange
|
Add time range menus to your glass table. Can be used in the particular data source. |
Options
Each input type supports one or more of the following options:
Setting | Description |
---|---|
token
|
Assign tokens to values or options selected by a user or created by a search. |
defaultValue
|
Sets a default value if a user fails to make a selection. |
items
|
Adds label-value pairs to inputs like dropdown and multiselect menus. |
Add an input
- Click the inputs icon
to display the input options.
- Select one of the input options:
- Dropdown
- Multi-select
- Text
- Number
- Time range
- Configure the following input options in the Configuration panel:
Input Option Description Title Specify a title for the input. Token Name Tokens are values made up of key/value pairs. The key is the name of the token and the value is the variable associated with the token name. - Configure additional settings depending on the selected input option.
Input Description Dropdown See Add a dropdown menu. Multi-select See Add a multiselect dropdown menu. Text See Add a text input menu. Number See Add a number input menu. Time range See Add a time range input menu.
Configure inputs in the source editor
You can also add inputs using the source editor. Add each input in the inputs
section of the glass table definition. You must also list each input you're using under globalInputs
in the layout
section.
You can optionally include the submitButton
option to add a submit button for the inputs. When set to true
, a user must click Submit for the selection to take effect. If set to false
or a blank value, the glass table immediately refreshes when a user makes a selection.
In the following example, two inputs have been added in addition to the default time picker and refresh rate:
"layout": {
"type": "absolute",
"globalInputs": [
"input_global_trp",
"input_global_refresh_rate",
"input1",
"input2"
],
"options": {
"showTitleAndDescription": true,
"width": 900,
"height": 600,
"display": "auto-scale",
},
}
Add a dropdown menu
Add a multiselect dropdown menu
Search-based inputs
You can populate dropdown
and multiselect
inputs by either static content or the results of a search. In the following example, search1
is passed to input1
to determine what appears in the dropdown. The selection of the input informs a token called component
. You can use that token in a viz option, another query parameter, or anywhere else you use tokens.
{
"dataSources": {
"search1": {
"type": "ds.search",
"options": {
"query": " index=_internal | stats count by sourcetype",
"queryParameters": {
"latest": "",
"earliest": "0"
}
}
}
},
"inputs": {
"input1": {
"type": "input.dropdown",
"options": {
"items": [
{
"label": "All",
"value": "*"
}
],
"token": "metricName",
"defaultValue": "*"
},
"encoding": {
"label": "primary[0]",
"value": "primary[0]"
},
"dataSources": {
"primary": "search1"
}
}
},
"layout": {
"type": "absolute",
"globalInputs": [
"input1"
]
},
"title": "Input",
"description": "",
"visualizations": {}
}
Add a text input menu
Add a number input menu
Add a time range input menu
How inputs connect to visualizations
Inputs affect visualizations when they generate tokens that are then specified in the visualization. For example, the following table visualization uses the token from an input to generate an overlay based on the user's selection.
{
"visualizations": {
"viz_table": {
"type": "viz.table",
"options": {
"dataOverlayMode": "$vizOverlay$"
}
}
}
}
Add tokens to create dynamic glass tables
Tokens are variables that pass a value within and between visualizations. They're usually made up of key/value pairs. The key is the name of the token and the value is the variable associated with the token name. If there's no key specified, you can specify a default.
You can use tokens in multiple ways within the glass table definition. For example, they can be used in search queries, inputs, and specifically stated within the dashboard definition.
Tokens in search queries
In the following example, the value of the limit
token is passed into the search string. You can set the token explicitly, such as "limit": 50
, or it can be assigned from a user input.
{
"type": "ds.search",
"options": {
"query": "index=_internal | head $limit$",
"queryParameters": {
"latest": "$global_time.latest$",
"earliest": "$global_time.earliest$"
},
"refresh": "$global_refresh_rate$",
"refreshType": "delay"
}
}
Tokens in visualizations
The following example gives the user a choice for a chart title using a dropdown menu and the resulting token, $viz.Title$
:
...
"viz_4lswmxKy": {
"type": "splunk.line",
"options": {},
"dataSources": {
"primary": "search1"
},
"title": "$dropdownTitle$"
},
...
...
},
"inputs": {
"input_dropdown": {
"options": {
"items": [
{
"label": "All",
"value": "*"
},
{
"label": "Item 1",
"value": "item001"
},
{
"label": "Item 2",
"value": "item002"
}
],
"defaultValue": "*",
"token": "dropdownTitle"
},
"title": "Dropdown Input Title",
"type": "input.dropdown"
},
...
}