Splunk Cloud Platform

Splunk Dashboard Studio

Acrobat logo Download manual as PDF


Acrobat logo Download topic as PDF

Text box

Use text inputs to let dashboard users pass any number or string to the input that defines a token used throughout the dashboard.

The following options are available:

  • defaultValue
  • token

The following example uses tokens set by one text input to determine the number of results returned and another to set the color of various visualization properties.

A dashboard with three multiselect inputs.

Expand this window to copy/paste the dashboard definition into your own dashboard.

{
	"visualizations": {
		"viz_R8trLpwN": {
			"type": "viz.table",
			"options": {
				"rowNumbers": true,
				"backgroundColor": "transparent",
				"headerBackgroundColor": "$hex$",
				"rowTextColorOdd": "#000000",
				"rowTextColorEven": "#294e70",
				"rowBackgroundColorOdd": "#ffffff",
				"headerTextColor": "#000000"
			},
			"dataSources": {
				"primary": "ds_BIdQZ95d"
			},
			"title": "Top $count$ Sourcetypes",
			"description": ""
		},
		"viz_mz81M1yZ": {
			"type": "viz.singlevalue",
			"options": {
				"backgroundColor": "$hex$"
			},
			"dataSources": {
				"primary": "ds_iRJ9rn8s"
			},
			"title": "Average Count of Top $count$ Sourcetypes",
			"description": "",
			"encoding": {}
		},
		"viz_aszgf6CD": {
			"type": "viz.text",
			"options": {
				"content": "Text Input",
				"fontWeight": "bold",
				"textColor": "#000000"
			}
		},
		"viz_Xgrs9smW": {
			"type": "viz.rectangle",
			"options": {
				"fill": "#708794",
				"stroke": "transparent",
				"rx": 4
			}
		},
		"viz_1oEXTiEw": {
			"type": "viz.rectangle",
			"options": {
				"fill": "#708794",
				"stroke": "transparent",
				"rx": 4
			}
		},
		"viz_AC5HOg5v": {
			"type": "viz.rectangle",
			"options": {
				"fill": "#ffffff",
				"stroke": "transparent",
				"rx": 4
			}
		},
		"viz_oXAXDETA": {
			"type": "viz.rectangle",
			"options": {
				"fill": "#ffffff",
				"stroke": "transparent",
				"rx": 4
			}
		},
		"viz_MncaqNG1": {
			"type": "viz.text",
			"options": {
				"content": "Number of sourcetypes shown  based on input count. \nColor of header bar changes based on input hex.",
				"fontSize": 14,
				"textColor": "#000000"
			}
		},
		"viz_nkQw0AQv": {
			"type": "viz.text",
			"options": {
				"content": "Dynamic Table Based on Text Inputs",
				"textColor": "#FFFFFF",
				"fontSize": 14,
				"fontWeight": "bold"
			}
		},
		"viz_ARvOjH9G": {
			"type": "viz.text",
			"options": {
				"content": "Text inputs allow users to choose titles, descriptions, and other forms of text entries. ",
				"fontSize": 14,
				"textColor": "#000000"
			}
		},
		"viz_fGDFzSpc": {
			"type": "viz.text",
			"options": {
				"content": "Dynamic Single Value Based on Text Inputs",
				"textColor": "#FFFFFF",
				"fontSize": 14,
				"fontWeight": "bold"
			}
		},
		"viz_TrOPFEfj": {
			"type": "viz.text",
			"options": {
				"content": "Average count changes from \"Input count\"\nBackground color changes from \"Input hex color\"",
				"fontSize": 14,
				"textColor": "#000000"
			}
		}
	},
	"dataSources": {
		"ds_BIdQZ95d": {
			"type": "ds.search",
			"options": {
				"query": "index=_internal | top limit=$count$ sourcetype | eval percent = round(percent,2)"
			},
			"name": "Search_1"
		},
		"ds_iRJ9rn8s": {
			"type": "ds.search",
			"options": {
				"queryParameters": {
					"earliest": "-24h@h",
					"latest": "now"
				},
				"query": "index=_internal | top limit=$count$ sourcetype | stats avg(count)"
			},
			"name": "Search_2"
		}
	},
	"inputs": {
		"input1": {
			"type": "input.text",
			"options": {
				"defaultValue": "5",
				"token": "count"
			},
			"title": "Input count:"
		},
		"input2": {
			"type": "input.text",
			"options": {
				"defaultValue": "#9964F1",
				"token": "hex"
			},
			"title": "Input hex color:"
		}
	},
	"layout": {
		"type": "absolute",
		"options": {
			"backgroundColor": "#ffffff",
			"width": 1500,
			"height": 700,
			"showTitleAndDescription": false,
			"display": "auto-scale"
		},
		"structure": [
			{
				"item": "viz_1oEXTiEw",
				"type": "block",
				"position": {
					"x": 770,
					"y": 160,
					"w": 700,
					"h": 470
				}
			},
			{
				"item": "viz_Xgrs9smW",
				"type": "block",
				"position": {
					"x": 30,
					"y": 160,
					"w": 710,
					"h": 470
				}
			},
			{
				"item": "viz_AC5HOg5v",
				"type": "block",
				"position": {
					"x": 790,
					"y": 210,
					"w": 660,
					"h": 380
				}
			},
			{
				"item": "viz_aszgf6CD",
				"type": "block",
				"position": {
					"x": 24,
					"y": 30,
					"w": 300,
					"h": 50
				}
			},
			{
				"item": "viz_oXAXDETA",
				"type": "block",
				"position": {
					"x": 50,
					"y": 210,
					"w": 670,
					"h": 380
				}
			},
			{
				"item": "viz_mz81M1yZ",
				"type": "block",
				"position": {
					"x": 920,
					"y": 300,
					"w": 390,
					"h": 250
				}
			},
			{
				"item": "viz_R8trLpwN",
				"type": "block",
				"position": {
					"x": 70,
					"y": 310,
					"w": 630,
					"h": 280
				}
			},
			{
				"item": "viz_MncaqNG1",
				"type": "block",
				"position": {
					"x": 70,
					"y": 220,
					"w": 360,
					"h": 70
				}
			},
			{
				"item": "viz_nkQw0AQv",
				"type": "block",
				"position": {
					"x": 50,
					"y": 170,
					"w": 530,
					"h": 80
				}
			},
			{
				"item": "viz_ARvOjH9G",
				"type": "block",
				"position": {
					"x": 30,
					"y": 80,
					"w": 570,
					"h": 50
				}
			},
			{
				"item": "viz_fGDFzSpc",
				"type": "block",
				"position": {
					"x": 790,
					"y": 160,
					"w": 530,
					"h": 80
				}
			},
			{
				"item": "viz_TrOPFEfj",
				"type": "block",
				"position": {
					"x": 800,
					"y": 220,
					"w": 360,
					"h": 70
				}
			}
		],
		"globalInputs": [
			"input1",
			"input2"
		]
	},
	"description": "Two text input examples shown changing SPL query, titles, coloring. ",
	"title": "Example — Text Input"
}
Last modified on 02 February, 2023
PREVIOUS
Multiselect
  NEXT
Number field

This documentation applies to the following versions of Splunk Cloud Platform: 9.1.2312, 8.2.2201, 8.2.2202, 8.2.2203, 9.0.2205, 9.0.2208, 9.0.2209, 9.0.2303, 9.0.2305, 9.1.2308 (latest FedRAMP release)


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