Token comparison between Dashboard Studio and Simple XML
Dashboard Studio and Simple XML dashboards use tokens for interactive experiences, with differences in predefined token names and functionalities.
In both Dashboard Studio and classic Simple XML dashboards, you can use tokens to create interactive experiences. There are differences between Dashboard Studio and Simple XML dashboards as to the names of predefined tokens and which token functionalities are available. This topic provides a comparison of what tokens are available.
Predefined tokens
| Token in Simple XML | Equivalent token in Dashboard Studio | Notes |
|---|---|---|
$click.bounds.<orientation>$ |
$row._geo_bounds_east.value$ $row._geo_bounds_north.value$ $row._geo_bounds_south.value$ $row._geo_bounds_west.value$ |
Only supported for bubble maps in Dashboard Studio. See Bubble map pre-defined tokens. |
$click.lat.name$ |
$row._geo_lat_field.value$ |
Only supported for bubble maps in Dashboard Studio. See Bubble map pre-defined tokens. |
$click.lat.value$ |
$row.<latitude field name>.value$ |
While Dashboard Studio does not have a predefined token for $click.lat.value$, you can access the value for the latitude field using $row.<fieldname>.value$. |
$click.lon.name$ |
$row._geo_lon_field.value$ |
Only supported for bubble maps in Dashboard Studio. See Bubble map pre-defined tokens. |
$click.lon.value$ |
$row.<longitude field name>.value$ |
While Dashboard Studio does not have a predefined token for $click.lat.value$, you can access the value for the longitude field using $row.<fieldname>.value$. |
$click.name$ |
$name$ |
|
$click.name2$ |
n/a | |
$click.value$ |
$value$ |
|
$click.value2$ |
n/a | |
$earliest$ |
$<time token>.earliest$ |
In Dashboard Studio, you can access a time token's earliest and latest values by using $<time token>.earliest$ and $<time token>latest$, respectively. For example, you can use $global_time.earliest$ to access the earliest time for the default global time range picker's time range. You can also define a custom time token and use $<time token>.earliest$ and $<time token>latest$ to access the beginning and end of its time range. |
$latest$ |
$<time token>.latest$ |
|
$row.<fieldname>$ |
$row.<fieldname>.value$ |
|
$row.<x-axis-name>$ |
$row.<x axis field name>.value$ |
While Dashboard Studio does not have a predefined token for $row.<x-axis-name>$, you can access the value for the x-axis field using $row.<fieldname>.value$. |
$trellis.name$ |
$trellis.name$ |
|
$trellis.split.<fieldname>$ |
n/a | |
$trellis.value$ |
$trellis.value$ |
Search tokens
Dashboard Studio and Simple XML dashboards both support using tokens to embed search-related information in other searches or visualizations. Dashboard Studio and Simple XML dashboards both support search tokens but use different syntax to do so.
$job.resultCount$. The following provides an example of the source code for a simple XML dashboard where $job.resultCount$ is nested under <search><query><earliest><done><condition> to set the value of a token called my_result_count, which is then used in the title of the table. Copy and paste this dashboard definition into your simple XML dashboard to see the example:
<dashboard version="1.1">
<label>Job Result Count Example</label>
<row>
<panel>
<search id="activity_by_sourcetype">
<query>index=_internal | head 20 | stats count by sourcetype</query>
<earliest>-15m</earliest>
<latest>now</latest>
<done>
<condition>
<set token="my_result_count">$job.resultCount$</set>
</condition>
</done>
</search>
<table>
<title>Found $my_result_count$ Results</title>
<search base="example_search"></search>
</table>
</panel>
</row>
</dashboard>
$my_result_count$ to 7, which is reflected in the table title:
$search name:job.resultCount$. For example, if the search name is "Activity by Sourcetype", you can access the result count for that search by enabling Access search results or metadata for the search, then using $Activity by Sourcetype:job.resultCount$. The following provides an example of the source code for a Dashboard Studio dashboard where $Activity by Sourcetype:job.resultCount$ is used in the title of a table. Copy and paste this dashboard definition into your Dashboard Studio dashboard to see the example:
{
"title": "Job Result Count Example",
"description": "",
"inputs": {},
"defaults": {
"visualizations": {
"global": {
"showProgressBar": true
}
}
},
"visualizations": {
"viz_jfGAYj93": {
"dataSources": {
"primary": "ds_kjA159j2"
},
"options": {
"showInternalFields": false
},
"title": "Found $Activity by Sourcetype:job.resultCount$ Results",
"type": "splunk.table"
}
},
"dataSources": {
"ds_kjA159j2": {
"name": "Activity by Sourcetype",
"options": {
"enableSmartSources": true,
"query": "index=_internal | head 20 | stats count by sourcetype",
"queryParameters": {
"earliest": "-24h@h",
"latest": "now"
}
},
"type": "ds.search"
}
},
"layout": {
"globalInputs": [],
"layoutDefinitions": {
"layout_1": {
"options": {
"display": "auto",
"height": 255,
"width": 1440
},
"structure": [
{
"item": "viz_jfGAYj93",
"position": {
"h": 250,
"w": 1440,
"x": 0,
"y": 0
},
"type": "block"
}
],
"type": "absolute"
}
},
"options": {},
"tabs": {
"items": [
{
"label": "New tab",
"layoutId": "layout_1"
}
]
}
},
}
$Activity by Sourcetype:job.resultCount$ to 4, which is reflected in the title of the table:
For a list of search job metadata options, see Search job metadata options.
Environment tokens
Dashboard Studio and Simple XML both support using environment tokens to embed user- or Splunk instance-related information within the dashboard. Both Dashboard Studio and Simple XML support the same environment tokens. See Environment tokens.
Eval tokens
Dashboard Studio and Simple XML both support setting token values by evaluating custom expressions. Dashboard Studio and Simple XML dashboards both support eval tokens but use different syntax to do so. For details on how to use eval tokens in Dashboard Studio, see Specify visibility conditions for panels and other dashboard elements.