Hi @BradOH, We'll use a solution similar to the referenced post but adapted to Dashboard Studio's quirks. As a starting point, we'll construct our search programmatically in SPL: | makeresults
| eval index="foo"
| eval field1="x"
| eval field2="y"
| eval field3="z"
| format This returns a single field named seach with the following value: ( ( field1="x" AND field2="y" AND field3="z" AND index="foo" ) ) Next, we'll define a pseudo-nullable input token with the default value set to a single space. Recall that Dashboard Studio trims whitespace from token values. While then token will indeed have a default value of a single space, it will display as an empty string. Editing the rendered input will remove the space, but clearing the rendered input will leave the (unrendered) space. In this way, the token is always defined and always satisfies implicit token dependencies: "input_nullable": {
"options": {
"defaultValue": " ",
"token": "text_field2_nullable"
},
"title": "Nullable Token",
"type": "input.text"
} Next, we'll translate our base search into a data source that dynamically sets field2 and interprets a single space as null value. Note that we're removing field2 from the search when it's "null." This allows the search to return results whether field2 exists in the event or not. If you want to limit search results to events where field2 exists, using "*" in place null(), e.g., field2 is optional: | makeresults
| eval index="foo"
| eval field1="x"
| eval field2=if($text_field2_nullable|s$==" ", null(), $text_field2_nullable|s$)
| eval field3="z"
| format or if field2 must exist: | makeresults
| eval index="foo"
| eval field1="x"
| eval field2=if($text_field2_nullable|s$==" ", "*", $text_field2_nullable|s$)
| eval field3="z"
| format If the format command doesn't produce the SPL you need, you can use the makeresults command and any SPL to define a field named search and construct any value you'd like using whatever SPL you'd like. You don't need to limit yourself to the eval command. You have the full suite of (safe) default and custom SPL commands and any data in your environment available to you: | makeresults
| eval search="index=foo field1=x field2=".if($text_field2_nullable|s$==" ", "*", $text_field2_nullable|s$)." field3=z"
| fields - _time (Note that the eval search ... example isn't entirely string-safe. Be mindful of token values that contain embedded whitespace. I'll leave that as an exercise for you.) The data source must have the "Access search results or metadata" option enabled ("enableSmartSources": true). We'll reference the result of the format command, the "search" result field, in our visualization elements: "dataSources": {
"ds_WKrsc3Ay": {
"name": "search_nullable_token",
"options": {
"enableSmartSources": true,
"query": "| makeresults \r\n| eval index=\"foo\" \r\n| eval field1=\"x\" \r\n| eval field2=if($text_field2_nullable|s$==\" \", null(), $text_field2_nullable|s$)\r\n| eval field3=\"z\"\r\n| format",
"queryParameters": {
"earliest": "0",
"latest": ""
}
},
"type": "ds.search"
}
} Finally, we'll use the $search_nullable_token:result.search$ token anywhere we need to reference the generated SPL: "visualizations": {
"viz_breCVkj9": {
"options": {
"markdown": "### SPL\n`$search_nullable_token:result.search$`"
},
"type": "splunk.markdown"
}
} Tying it all together: {
"title": "Nullable Token (Legacy)",
"description": "",
"inputs": {
"input_global_trp": {
"options": {
"defaultValue": "-24h@h,now",
"token": "global_time"
},
"title": "Global Time Range",
"type": "input.timerange"
},
"input_nullable": {
"options": {
"defaultValue": " ",
"token": "text_field2_nullable"
},
"title": "Nullable Token",
"type": "input.text"
}
},
"defaults": {
"dataSources": {
"ds.search": {
"options": {
"queryParameters": {
"earliest": "$global_time.earliest$",
"latest": "$global_time.latest$"
}
}
},
"ds.spl2": {
"options": {
"queryParameters": {
"earliest": "$global_time.earliest$",
"latest": "$global_time.latest$"
}
}
}
},
"visualizations": {
"global": {
"showProgressBar": true
}
}
},
"visualizations": {
"viz_breCVkj9": {
"options": {
"markdown": "### SPL\n`$search_nullable_token:result.search$`"
},
"type": "splunk.markdown"
}
},
"dataSources": {
"ds_WKrsc3Ay": {
"name": "search_nullable_token",
"options": {
"enableSmartSources": true,
"query": "| makeresults \r\n| eval index=\"foo\" \r\n| eval field1=\"x\" \r\n| eval field2=if($text_field2_nullable|s$==\" \", null(), $text_field2_nullable|s$)\r\n| eval field3=\"z\"\r\n| format",
"queryParameters": {
"earliest": "0",
"latest": ""
}
},
"type": "ds.search"
}
},
"layout": {
"globalInputs": [
"input_nullable",
"input_global_trp"
],
"layoutDefinitions": {
"layout_1": {
"options": {
"height": 960,
"width": 1440
},
"structure": [
{
"item": "viz_breCVkj9",
"position": {
"h": 400,
"w": 1440,
"x": 0,
"y": 0
},
"type": "block"
}
],
"type": "grid"
}
},
"options": {},
"tabs": {
"items": [
{
"label": "New tab",
"layoutId": "layout_1"
}
]
}
}
}
... View more