As @kml_uvce says, Dashboard Studio does not replicate Simple XML features cleanly. Here, "cleanly" is the key word. You did not specify the exact result you are trying to get by setting either $ERRORS$ or $WARNINGS$. But DS can achieve most effect you want to implement. (I ran into an unexpected bug while testing one use case; I will explain that later.) The most common use case of setting conditional token names is for them to be used on the dashboard itself, mostly to hide or reveal an element as kml_uvce suggests. (Because you cannot use unset token in search, $ERRORS$ and $WARNINGS$ cannot appear in the same panel even in Simple XML.) So, I constructed this dashboard to demonstrate two methods to achieve such hide-and-seek interaction. {
"title": "Drilldown from column chart",
"description": "https://community.splunk.com/t5/Dashboards-Visualizations/How-to-Create-a-drill-down-from-a-column-chart/m-p/761714/highlight/true#M59493",
"inputs": {},
"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_FwYm3SJW": {
"containerOptions": {
"visibility": {
"showConditions": [
"condition_brJLKJTd"
]
}
},
"options": {
"markdown": "Only show if *ERROR* is clicked!\n\nDo some search with $ set stuff conditionally:result.error_clicked $ (value is $set stuff conditionally:result.error_clicked$)"
},
"type": "splunk.markdown"
},
"viz_b4Bxi3gB": {
"dataSources": {
"primary": "ds_Oaqhxumn"
},
"eventHandlers": [
{
"options": {
"tokens": [
{
"key": "name",
"token": "click_col"
},
{
"key": "value",
"token": "click_val"
},
{
"token": "info_clicked_tok",
"value": "$set stuff conditionally:result.info_clicked$"
}
]
},
"type": "drilldown.setToken"
}
],
"title": "this is your column chart",
"type": "splunk.table"
},
"viz_o3sdPo7w": {
"containerOptions": {
"visibility": {
"showConditions": [
"condition_5dQcfJWD"
]
}
},
"options": {
"markdown": "This panel only shows if clicked value is **greater than** 0\n\n> clicked name: $click_col$\n\n> clicked value: $click_val$"
},
"type": "splunk.markdown"
},
"viz_o6JLZxMy": {
"dataSources": {
"primary": "ds_U44DG9ro"
},
"title": "output from >set stuff conditionally<",
"type": "splunk.table"
},
"viz_xM7oEpU3": {
"options": {
"markdown": "values in \"set stuff conditionally\" search. Formula is\n`$<search name>.result.<field name>$`\n\n- $ set stuff conditionally:result.info_clicked $: $set stuff conditionally:result.info_clicked$\n- $ set stuff conditionally:result.warn_clicked $: $set stuff conditionally:result.warn_clicked$\n- $ set stuff conditionally:result.warning_clicked $: $set stuff conditionally:result.warning_clicked$\n- $ set stuff conditionally:result.error_clicked $: $set stuff conditionally:result.error_clicked$"
},
"type": "splunk.markdown"
},
"viz_y668z7ad": {
"containerOptions": {
"visibility": {
"showConditions": [
"condition_6zVp0DS6"
]
}
},
"options": {
"markdown": "Only show if **WARN** is clicked!\n\nDo some search with $ set stuff conditionally:result.warn_clicked $ (value is $set stuff conditionally:result.warn_clicked$)"
},
"type": "splunk.markdown"
},
"viz_zugP9Nmm": {
"containerOptions": {
"visibility": {
"showConditions": [
"condition_BiyxjNkX"
]
}
},
"options": {
"markdown": "This panel only shows after click\n\nYou last clicked\n\n> Field name (i.e., $ click_col $): $click_col$\n\n> Field value (i.e., $ click_val $): $click_val$"
},
"type": "splunk.markdown"
}
},
"dataSources": {
"ds_Oaqhxumn": {
"name": "column chart search",
"options": {
"query": "index=_internal log_level=*\n| chart count over sourcetype by log_level",
"queryParameters": {
"earliest": "-24h@h",
"latest": "now"
}
},
"type": "ds.search"
},
"ds_U44DG9ro": {
"name": "set stuff conditionally",
"options": {
"enableSmartSources": true,
"query": "| makeresults format=csv data=\"token_name\ndummy\"\n| eval error_clicked = if(\"$click_col$\" == \"ERROR\", $click_val$, \"iNvAlId\")\n| eval warn_clicked = if(\"$click_col$\" == \"WARN\", $click_val$, \"iNvAlId\")\n| eval warning_clicked = if(\"$click_col$\" == \"WARNING\", $click_val$, \"iNvAlId\")\n| eval info_clicked = if(\"$click_col$\" == \"INFO\", $click_val$, \"iNvAlId\")\n",
"queryParameters": {
"earliest": "-24h@h",
"latest": "now"
}
},
"type": "ds.search"
}
},
"layout": {
"globalInputs": [],
"layoutDefinitions": {
"layout_1": {
"options": {
"height": 960,
"width": 1440
},
"structure": [
{
"item": "viz_b4Bxi3gB",
"position": {
"h": 352,
"w": 1112,
"x": 0,
"y": 0
},
"type": "block"
},
{
"item": "viz_zugP9Nmm",
"position": {
"h": 176,
"w": 328,
"x": 1112,
"y": 0
},
"type": "block"
},
{
"item": "viz_o3sdPo7w",
"position": {
"h": 176,
"w": 328,
"x": 1112,
"y": 176
},
"type": "block"
},
{
"item": "viz_o6JLZxMy",
"position": {
"h": 162,
"w": 549,
"x": 0,
"y": 352
},
"type": "block"
},
{
"item": "viz_xM7oEpU3",
"position": {
"h": 162,
"w": 445,
"x": 549,
"y": 352
},
"type": "block"
},
{
"item": "viz_y668z7ad",
"position": {
"h": 162,
"w": 223,
"x": 994,
"y": 352
},
"type": "block"
},
{
"item": "viz_FwYm3SJW",
"position": {
"h": 162,
"w": 223,
"x": 1217,
"y": 352
},
"type": "block"
}
],
"type": "grid"
}
},
"options": {},
"tabs": {
"items": [
{
"label": "New tab",
"layoutId": "layout_1"
}
]
}
},
"expressions": {
"conditions": {
"condition_5dQcfJWD": {
"name": "clicked value greater than 0",
"value": "$click_val$ > 0"
},
"condition_6zVp0DS6": {
"name": "WARN clicked",
"value": "$set stuff conditionally:result.warn_clicked$ != \"iNvAlId\""
},
"condition_BiyxjNkX": {
"name": "a click is performed",
"value": "isSet($click_col$)"
},
"condition_brJLKJTd": {
"name": "ERROR clicked",
"value": "$set stuff conditionally:result.error_clicked$ != \"iNvAlId\""
}
}
}
} Upon launch, a "minimal" layout is shown, including one panel with warning about no search result. When you click in column chart, layout will change depending on where you click, e.g., Play with the demo and see if your desired effects can be achieved. A few pointers. DS provides many visual aids. This demo dashboard is completely designed in UI, including logical conditions used to hide or show a visual element. (Although some aids may not be available in 9.4; I am using 10.2.) The demo uses two different mechanisms for interaction. One is via traditional tokens $click_col$ and $click_val$. As kml_uvce mentions, they are sufficient for simpler use cases. The second method is explained next. In DS, building conditional field names, values based on click does not require traditional concept of "token" such as $ERRORS" or "WARNINGS". This is because DS makes creation, maintenance, and reference to supplemental searches extremely easy. Once you decide on logic, create a search based on your logic as a standalone data source, check "Access search results or metadata" if you do not use this source in a visual element. Then, use $<data source name>:result.<field name>$ anywhere a token can be used. In the demo, these "conditional tokens" are calculated with makeresults; but you can totally create supplemental data sources using index search or any other generating command. (BTW, use of supplemental search/data source is not limited to interacting with clicks; you can totally use them in any way you use a rendered value.) Although you can technically do the same in Simple XML, it is much, much messier. DS lacks the unset feature for tokens (and search results). So, some workaround is needed if something depends on them to be unset. In the demo, I use the value "iNvAlId" to signify unset. (null() assignment does not unset anything. DS simply retains last set value.) DS allows traditional token value to be set to output of any data source including a supplemental data source. (Traditional token is needed when interacting outside the current dashboard.) In theory, this achieves calculated token like you can do in Simple XML, only easier to maintain in DS. But in today's testing, I notice that the (traditional) token value, if set via a secondary data source based on click name/value, is lagging behind by one click. I consider this a bug. In short, Dashboard Studio can be strong even in complex interactions, as long as you are willing to adapt to its own feature set. (I am keenly aware of the absence of some desirable features in Simple XML, but the set is smaller and smaller.) This is how I see the situation: If you are already proficient in Simple XML, and there are some effects that are harder/impossible to achieve in DS, stay with Simple XML. Else it is worth venturing into DS even if sometimes that requires a different way to solve the problem. I have used Simple XML for many years and still have many dashboards there. But my goto for new dashboard today is Dashboard Studio.
... View more