Hi,
In Splunk Classic (Simple XML) dashboards, a delimiter property could be set for a multi-select input to control how the selected values are concatenated into the token (for example , instead of ,).
I’m now building a dashboard in Splunk Dashboard Studio (absolute layout) and I need the token values to look like this:
"select1", "select2", "select3"
Instead of the default:
"select1,select2,select3"
I tried adding "delimiter": ", " to the multiselect JSON definition, but I get:
must NOT have additional properties
So my questions are:
Is there any supported way in Dashboard Studio to define a custom delimiter with space, or should I handle it only in SPL using mvjoin() or another function?
Is there an official reference or documentation where I can see all supported keys and properties for the JSON schema of Dashboard Studio inputs?
Example of what I tried:
{
"type": "input.multiselect",
"options": {
"items": [...],
"delimiter": ", "
}
}
Thanks!
Hi @Yoavraham14
This is achievable using another search - I usually do this in a table which I hide off the canvas - Here is an example, you can manipulate as required and then use the recreated token value in your search using $SearchName:result.fieldName$ - See examples below:
Full JSON example:
{
"title": "DS - Multivalue select",
"description": "",
"inputs": {
"input_DgsOd4RE": {
"options": {
"defaultValue": [
"item001",
"item002"
],
"items": [
{
"label": "All",
"value": "*"
},
{
"label": "Item 1",
"value": "item001"
},
{
"label": "Item 2",
"value": "item002"
},
{
"label": "Item 3",
"value": "item003"
},
{
"label": "Item 4",
"value": "item004"
},
{
"label": "Item 5",
"value": "item005"
},
{
"label": "Item 6",
"value": "item006"
}
],
"token": "ms_1"
},
"title": "Multiselect Input Title",
"type": "input.multiselect"
},
"input_global_trp": {
"options": {
"defaultValue": "-24h@h,now",
"token": "global_time"
},
"title": "Global Time Range",
"type": "input.timerange"
}
},
"defaults": {
"dataSources": {
"ds.search": {
"options": {
"queryParameters": {
"earliest": "$global_time.earliest$",
"latest": "$global_time.latest$"
}
}
}
},
"visualizations": {
"global": {
"showProgressBar": true
}
}
},
"visualizations": {
"viz_C3bnEw97": {
"options": {
"markdown": "MS_1 value: $ms_1$ \nmv_or value: $MS_Fix:result.mv_or$"
},
"type": "splunk.markdown"
},
"viz_GpbDMA4d": {
"dataSources": {
"primary": "ds_NOGZnkDa"
},
"options": {},
"type": "splunk.table"
},
"viz_ZuR0IdYV": {
"dataSources": {
"primary": "ds_O3KgoHld"
},
"options": {},
"type": "splunk.table"
}
},
"dataSources": {
"ds_NOGZnkDa": {
"name": "Search_1",
"options": {
"query": "| makeresults count=8\n| streamstats count\n| eval myField=\"item00\".count\n| eval hash=md5(myField)\n| fields - _time count\n| search $MS_Fix:result.mv_or$"
},
"type": "ds.search"
},
"ds_O3KgoHld": {
"name": "MS_Fix",
"options": {
"enableSmartSources": true,
"query": "| makeresults \n| eval mv=split(\"$ms_1$\",\",\")\n| eval mv_or=\"myField=\".mvjoin(mv,\" OR myField=\")\n"
},
"type": "ds.search"
}
},
"layout": {
"globalInputs": [
"input_global_trp",
"input_DgsOd4RE"
],
"layoutDefinitions": {
"layout_1": {
"options": {
"display": "auto",
"height": 960,
"width": 1440
},
"structure": [
{
"item": "viz_C3bnEw97",
"position": {
"h": 40,
"w": 770,
"x": 10,
"y": 10
},
"type": "block"
},
{
"item": "viz_ZuR0IdYV",
"position": {
"h": 140,
"w": 660,
"x": 10,
"y": 70
},
"type": "block"
},
{
"item": "viz_GpbDMA4d",
"position": {
"h": 300,
"w": 790,
"x": 10,
"y": 250
},
"type": "block"
}
],
"type": "absolute"
}
},
"options": {},
"tabs": {
"items": [
{
"label": "New tab",
"layoutId": "layout_1"
}
]
}
}
}
🌟 Did this answer help you? If so, please consider:
Your feedback encourages the volunteers in this community to continue contributing
Dashboard Studio is still behind the capabilities of SimpleXML in a number of areas, particularly when it comes to customisations. If you need the customisations, you may be better off waiting until Studio catches up, or live with the limitations of Studio.
@Yoavraham14
As per Splunk documentation, Dashboard Studio does not support a delimiter property in the multiselect input configuration. The only supported multiselect input delimiter is the comma, so use the IN operator and format your queries appropriately
#https://docs.splunk.com/Documentation/Splunk/latest/DashStudio/inputMulti
Recommended approach, as you mentioned to use SPL functions only.
Regards,
Prewin
Splunk Enthusiast | Always happy to help! If this answer helped you, please consider marking it as the solution or giving a Karma. Thanks!