Splunk-6 5 7-Viz
Splunk-6 5 7-Viz
Events List.............................................................................................................................................................................6
Using events lists.......................................................................................................................................................6
Table Visualizations.............................................................................................................................................................8
Table visualization overview......................................................................................................................................8
Generate a table........................................................................................................................................................8
Format table visualizations........................................................................................................................................9
Table column Simple XML.......................................................................................................................................15
Charts..................................................................................................................................................................................23
Chart overview.........................................................................................................................................................23
Data for charts.........................................................................................................................................................24
Pie chart...................................................................................................................................................................25
Column and bar charts............................................................................................................................................26
Line and area charts................................................................................................................................................30
Scatter chart............................................................................................................................................................34
Bubble chart.............................................................................................................................................................35
Chart display issues.................................................................................................................................................36
Single Value........................................................................................................................................................................39
Overview..................................................................................................................................................................39
Generate a single value...........................................................................................................................................39
Customize a single value.........................................................................................................................................41
Gauges.................................................................................................................................................................................44
Using gauges...........................................................................................................................................................44
Maps.....................................................................................................................................................................................47
Mapping data...........................................................................................................................................................47
Generate a Choropleth map....................................................................................................................................47
Configure a Choropleth map....................................................................................................................................50
Cluster maps............................................................................................................................................................51
i
Table of Contents
Build and Edit Dashboards in Splunk Web
Add panels to dashboards.......................................................................................................................................59
Edit dashboards.......................................................................................................................................................63
Edit visualizations....................................................................................................................................................65
Create and edit forms..............................................................................................................................................67
Convert a dashboard to HTML................................................................................................................................80
ii
Introduction
Getting started
Learn how to share insights with data visualizations and dashboards.
To view a PDF that offers you a short overview of the most common operations, definitions, and commands you will use
when you create dashboards and visualizations, see the Splunk Dashboards Quick Reference Guide.
You might need to generate a new visualization or edit an existing dashboard. Working with dashboards and
visualizations includes one or more of the following tasks.
Select a visualization
• Write a search to generate a visualization. Make sure that the search returns results in the correct format for
rendering the visualization. See Data structure requirements for visualizations for an overview about data
formatting.
• Configure or update visualization appearance and behavior. Change color modes, add captions, or adjust other
visualization elements. See the Visualization reference for an overview of options and links to details on each
visualization type.
• Export dashboards for sharing. To get started, see Generate dashboard PDFs.
• Manage permissions for viewing and editing dashboards. See Configure dashboard permissions for details.
1
• Clone a dashboard or display a dashboard on the app home page. To learn more, see Clone and manage
dashboards.
• Use Simple XML source code to customize dashboard content and behavior. See About editing Simple XML for
an overview and the Simple XML reference for more details.
2
Get Started with Visualizations
Visualization reference
Compare options and select a visualization to show the data insights that you need.
To quickly view the most fundamental overview of common visualizations and their use cases, note that you can access
the Splunk Dashboards Quick Reference guide by clicking the link in Getting started.
Table
• Isolate one or more specific fields from search results. Table visualization overview
• Add formatting to highlight trends or patterns in specific
fields.
Single value
Show an aggregated metric in context.
Single value overview
• Track recent changes or trends in real time.
• Use colors to add context dynamically.
Gauges
3
Visualization Usage To learn more see
This topic provides an overview of data structures for visualizations. To learn about requirements for a specific
visualization and how to generate results in the correct format, see one of the following topics.
Events list
Using events lists
Table visualizations
Generate a table
Charts
Pie chart
Column and bar charts
Line and area charts
Scatter chart
Bubble chart
Single value
Generate a single value
Gauges
Using gauges
Maps
Mapping Data
For an overview of visualization options, see the Visualization Reference in this manual.
Depending on the visualization that you are creating, you can use specific search commands to generate results in the
correct format. For example, many visualizations require a search using transforming commands, such as stats, chart,
timechart, or geostats to render.
4
Charts visualize one or more data series, or related data points. Depending on the chart type or complexity, the number
and ordering of data series can vary.
Maps combine a query and other data components, including data with coordinates or place information, lookup
definitions, and geographical markup files.
When creating a visualization, you can check the Statistics table after running a search to make sure that result fields are
generated correctly. The number and order of Statistics table columns show you the data structure that a search
generated.
Additional information
Review specific visualization topics to check data format requirements and query recommendations.
To learn more about search commands that can generate visualizations, see the following topics.
5
Events List
The content in an events list depends on the search that you run. There are no additional data format requirements.
Prerequisites
Review Configuration options.
Steps
Configuration options
Use the Format menu to configure one or more of the following events list components. You can also adjust these
components and make additional configurations using Simple XML.
Drilldown
When configuring drilldown on an events list in Simple XML, you can specify one of the following drilldown settings to
provide different segment selection options.
Drilldown
Segmenting option enabled for users Example
setting
Full Select a major segment or one or more contiguous minor
segments.
6
Drilldown
Segmenting option enabled for users Example
setting
For more details, see Types of event segmentation in the Knowledge Manager Manual.
An admin uses an events list to give users access to recent notable system events. To generate the events list, the admin
runs the following search.
The admin adds the events list to a dashboard tracking system status. Dashboard users can click on event fields or a
timestamp in the list to open a search using the clicked content.
For example, clicking on the /opt/splunktest/var/log/splunk/metrics.log source value in an event opens the following
search in a new window.
index=_internal source="/opt/splunktest/var/log/splunk/metrics.log"
7
Table Visualizations
Learn how to generate and configure a table visualization. See the following topics for details.
• Generate a table
• Format table visualizations
• Table column Simple XML
Generate a table
To generate a table, write a search that includes a transforming command. From the Search page, run the search and
select the Statistics tab to view and format the table.
You can use the table command in a search to specify the fields that the table includes or to change table column order.
Search examples
• Transforming search
This search uses the chart transforming command.
8
The search generates a table with two columns.
To change the columns that appear in the table or to change column order, add the table command to this
search. For example, add | table host count to generate a table with only the host and count columns.
Table sparklines
Sparklines show data patterns or trends in a results set. To generate a table sparkline, usestats or chart with the
sparkline function in a search.
Sparkline width is determined by default data binning. You can adjust data binning as a parameter of the sparkline
command.
For more information, see Add Sparklines to your search results in the Search Manual.
Use the Format menu Summary tab to include column totals and percentages. For each statistic, a highlighted summary
row appears at the bottom of the table. Column totals and/or percentages appear at the bottom of each column that
contains numeric values.
9
Note: Values in a summary row reflect statistics for the complete search result set. For tables with more than one page of
results, summary row values do not apply only to the currently displayed page.
There are some behavior and formatting differences between summary rows and data rows in a table.
Values in the row can skew table color formatting or data overlay No Yes
A static summary row fits most use cases. If you generate a totals data row using the addcoltotals SPL command in a
search, note the following table behavior impacts.
The following examples show use case scenarios for adding column totals and percentage rows to a table.
An analyst for an online retailer is evaluating how customer actions, such as purchases or quantity changes, relate to
product types. The analyst is also comparing the relative frequency of different customer actions.
The following query generates a table showing product type counts for each customer action.
Using the Format menu, the analyst adds a totals summary row to the table.
10
The totals row shows relative totals for each customer action. For instance, there were 952 purchase events in the results
set, compared to 98 product removal events.
An analyst creates a table showing purchasing activity on a retail website. The following query generates results
comparing purchases for different product types.
The analyst uses the Format menu to include a percentage row in the table.
This row shows a percentage for each product type relative to all purchases. For example, arcade games make up 19.4
percent of all purchases.
You can format individual table columns to add context or focus to the visualization. Click on the paintbrush icon at the top
of each column to customize color and number formatting.
11
Note: Column formatting is not available for columns representing the _time field or for sparkline columns.
Column color
Select and configure one of the following color modes for the column.
Note: Column color formatting overrides existing heat map or high/low value data overlay settings.
Scale
Use a sequential or divergent color scale on column cells. You can choose a preset scale or a custom configuration to
manage how colors in the scale are applied to column cells.
Depending on search results and data distribution, column color gradation can vary. Columns with relatively similar values
will show the most color gradation. Outlying values can limit the gradation.
Scale
Description Example
type
This example column has sequential coloring. It is also sorted to show the highest
values at the top.
Divergent A divergent scale can show how results This example column has divergent coloring. It shows the lowest values at the top
approach high and low values. and the highest values at the bottom.
12
Scale
Description Example
type
Configuration options
Indicate numeric value thresholds. Cell color is determined • Show department course enrollment
Number
according to how values align with the three thresholds. according to small, medium, and large roster
size.
Percent Determine cell color using percentages of the results value range.
• Show student test scores on a final exam.
Use ranges to compare cell values categorically. For example, use red, yellow and green range colors to indicate low,
medium, and high sales results.
13
Values
Use automatic value coloring or define custom rules. Automatic coloring applies a color to every cell in the column. Cells
with the same value appear in the same color.
Custom rules can help highlight specific values that you are monitoring. For example, use custom rules to highlight three
new products in recent sales data.
Number format
Enable and adjust number formatting for each column. The number format settings panel includes the following options.
After generating a table, use the Format menu to configure one or more of the following table components.
14
Data overlay
The Format menu also includes the following data overlay options.
Heat map
Add different shades of a particular color to the table to show value variation over table rows.
Use data overlay if you are not adding column color formatting to the table. Column color formatting overrides data
overlay configurations.
Drilldown
You can choose one of these three options for table drilldown behavior.
Row Opens a secondary search using the field and values from cells in the selected row.
Indicate color scale and color palette rules to manage column color formatting. You can also use a number format rule to
manage the appearance of numeric cell values.
Put all table formatting rules inside the <table> dashboard element.
<table>
[...]
</table>
To create a new format rule, indicate a format rule type and a column where you want to apply the rule. Use the following
syntax.
If you do not specify a field, the format rule is applied to the entire table.
15
Color format rules
To add column color, create a format rule with type "color" and the column name where you want to apply the rule.
Start configuring column color by specifying a color scale type. The color scale type indicates how color is applied to
values in the cell. After defining a color scale, you can add a color palette to indicate which colors to use for the column.
category
Apply colors to the column based on category. You can provide an optional category list to pre-populate the color scale.
Additional categories that occur in results are added after the specified categories.
linear
Map numeric data on a linear scale.
log
Map numeric data on a logarithmic scale.
16
Options and accepted values Example
minMidMax
Map numeric data according to a range with a minimum, midpoint, and maximum value.
Example
sharedCategory
Use this scale type with the sharedList palette to apply automatic formatting to this column.
17
Options and accepted values Example
</colorPalette>
</format>
threshold
Specify a set of finite value thresholds for binning data.
Once you define a color format rule and add a color scale to it, include a color palette type and options. The color palette
determines which colors the scale applies to column cells.
expression
Use a logical expression that returns a color for a particular value.
• #FFF
• #FFFFFF
• 0xFFF
• 0xFFFFFF
• rgb(255, 255, 255)
• rgba (255, 255, 255, 1)
Example
This example expression applies the color #65A637 to cells with the value splunkd. For cells with other values, the color
#0000CC is used.
list
Specify a list of color strings for this palette.
18
Color string formats
Use any of the following formats.
• #FFF
• #FFFFFF
• 0xFFF
• 0xFFFFFF
• rgb(255, 255, 255)
• rgba (255, 255, 255, 1)
Example
map
Specify a map of one or more cell value and color string pairs.
• #FFF
• #FFFFFF
• 0xFFF
• 0xFFFFFF
• rgb(255, 255, 255)
• rgba (255, 255, 255, 1)
Example
minMidMax
Specify minimum and maximum or minimum, mid, and maximum colors to use in generating a color gradient. Gradient
values are interpolated between the specified colors.
• minColor (Required)
• midColor (Optional)
19
• maxColor (Required)
• #FFF
• #FFFFFF
• 0xFFF
• 0xFFFFFF
• rgb(255, 255, 255)
• rgba (255, 255, 255, 1)
Example
sharedList
Use this palette with the sharedCategory color scale to apply automatic formatting to this column.
Example
20
Name Description Accepted values and defaults
Use any String. For best results, use
an abbreviation or other brief label
text.
[before | after ]
unitPosition Indicate where to place the unit label.
Defaults to after.
<table>
<search>
<query>index=_internal | head 10000 | stats count by sourcetype</query>
</search>
<format type="number" field="count">
<option name="precision">3</option>
<option name="useThousandSeparators">false</option>
<option name="unit">MB</option>
<option name="unitPosition">before</option>
</format>
</table>
Columns represent product categories and id codes, as well as item sales totals. Format rules help distinguish categories,
highlight particular items, and show relative sales metric density across all products.
21
The source code includes color scale, palette, and number format rules.
<dashboard>
<label>Sales performance</label>
<row>
<panel>
<title>Sales this month</title>
<table>
<title>Accessories and arcade game sales</title>
<search>
<query>source="tutorialdata (1).zip:*" | stats count by categoryId, itemId | table categoryId
itemId count</query>
<earliest>0</earliest>
<sampleRatio>1</sampleRatio>
</search>
<option name="count">20</option>
<option name="dataOverlayMode">none</option>
<option name="drilldown">cell</option>
<option name="rowNumbers">false</option>
<option name="wrap">true</option>
<format type="color" field="itemId">
<colorPalette type="map">{"EST-15":#D93F3C,"EST-7":#6DB7C6}</colorPalette>
</format>
<format type="color" field="categoryId">
<colorPalette
type="map">{"ACCESSORIES":#6DB7C6,"ARCADE":#F7BC38,"STRATEGY":#AFEEEE}</colorPalette>
</format>
<format type="color" field="count">
<colorPalette type="minMidMax" maxColor="#31A35F" midColor="#A2CC3E"
minColor="#FFFFFF"></colorPalette>
<scale type="minMidMax" maxType="percentile" maxValue="100" midType="percentile" midValue="50"
minType="percentile" minValue="0"></scale>
</format>
<format type="number" field="count">
<option name="precision">0</option>
<option name="unit">units</option>
</format>
</table>
</panel>
</row>
</dashboard>
22
Charts
Chart overview
Select a chart type to show one or more data dimensions in a results set. Learn how charts visualize data series.
For a quick glance at common charts and common chart use case commands, you can view the Splunk Dashboards
Quick Reference guide by clicking the link in Getting started.
Select a chart
You can select a chart depending on the number of data dimensions that you want to visualize. For example, use a pie
chart to show how values combine in a single field. A bubble chart can show relationships between multiple fields in a
data set.
23
Chart type Description
Get started
The following topics show you how to build and configure charts.
A series is a sequence of related data points. These points can be plotted on a chart. For example, each line in a line
chart shows one series.
When you run a transforming search, select the Statistics tab. Review the statistics table to see the series generated.
After the first column, each additional column represents a series. A single series search generates two columns. A
multiple series search generates three or more columns.
Different chart types are optimized to visualize one or more data series.
Scatter No Yes Scatter charts work best with two data series.
Bubble No Yes Bubble charts work best with three data series.
24
Pie chart
Use a pie chart to show how different field values combine over an entire data set. Each slice of a pie chart represents the
relative importance or volume of a particular category.
Data formatting
Check the Statistics table after running the search to make sure that a single series generated. The table should have
two columns.
The first table column contains labels for each pie slice. The second column contains the numerical values that
correspond to each label. The numerical values determine the relative size of each slice.
If the search generates a table with more than two columns, the extra columns are ignored.
Configuration options
You can use the Format menu to configure the following pie chart components.
Drilldown
Drilldown in a pie chart lets users click on a pie slice to open a secondary search using the clicked values. You can enable
or disable drilldown using the Format menu.
Minimum size
Set a minimum percentage size to apply when there are more than 10 slices. Data values below the minimum percentage
are combined into an other slice.
25
Create a pie chart
Prerequisites
Review the following details about building pie charts.
• Data formatting
• Configuration options
Steps
Examples
The chart is configured with a 5% minimum size. Field values that represent less than 5% of the total data set are
combined into an other slice.
This search uses the bytes and source fields to generate a single series.
Here, the source column provides pie slice labels. The avg(bytes) column provides the relative size of each slice, as
percentages of the sum of avg(bytes) returned by the search.
26
Data formatting
Column and bar charts represent one or more data series. To make sure that a search generates one or more series,
check the Statistics tab. The table should have at least two columns.
Search results not structured as a table with valid x-axis or y-axis values cannot generate column or bar charts. For
example, using the eval or fields commands might change search result structure.
Column charts get x-axis values from the first column in the table. The next table columns contain y-axis values.
Bar charts get y-axis values from the first column in the table. The next table columns contain x-axis values.
As an example, any search using the timechart reporting command generates a table where _time is the first column. A
column chart generated with this search has a _time x-axis. A bar chart using this search has a _time y-axis.
Column and bar charts can visualize single or multiple data series. The following examples show you how to generate
these series.
Single series
A search compares the average number of bytes passed through each source. In this search, the over operator indicates
that source is the first table column.
Column chart
source values are used for the x-axis. The y-axis in the column chart is avg(bytes).
Bar chart
avg(bytes) values are used for the x-axis. The bar chart y-axis would represent source field values.
To generate multiple data series, introduce the timechart command to add a _time field to search results. You can also
change the query to introduce a split-by field.
For example, change the previous single series search by adding clientip as a split-by field.
27
...| chart avg(bytes) over source by clientip
The split-by field produces multiple data series. Each clientip is a data series with its own avg(bytes) values for each
source.
To show multiple series in a bar or column chart, use the Format menu to configure stacking and multi-series mode.
Configuration options
Use the Format menu to customize one or more of the following column and bar chart components.
• Chart titles
• Axis titles
• Minimum and maximum axis values
• Use a logarithmic unit scale. This option is helpful when there are very small and very large axis values.
• Chart legend placement and text truncation
• Label rotation
• Enable or disable drilldown. When drilldown is enabled, users can click on a column, bar, or chart legend to open
a search in a new window. The search uses values from the selected element.
If the chart represents multiple data series, you can also configure the following options.
Multi-series mode
Compare trends across multiple series. Enable the mode to show independent axis ranges for each series.
Stacked charts
Use a stacked chart to see more details for values in a particular field. You can select unstacked, stacked, and 100%
stacked bar and column charts. See the following comparison.
Stack
Column or bar appearance Use case
option
An unstacked chart is useful for a lower number of series. As the
Columns or bars for different series appear next to each
Unstacked number of series increases, the chart can become more difficult to
other.
understand.
Data points within a series appear as segments of a column Use a stacked column or bar chart to highlight the relative volume,
Stacked or bar. The total column or bar value is the sum of all of the frequency, or importance of data points in a series. See the
segments. stacked chart example below.
28
Create a column or bar chart
Prerequisites
Review the following details about building column and bar charts.
• Data formatting
• Configuration options
Steps
Examples
Bar chart
This search calculates a CPU seconds sum for each processor. The search also sorts the processors with the ten highest
sums in descending order.
This search portion aggregates events according to code values over time. The query specifies the _time field and Code
field values to include. This query generates a series for each Code field value.
29
Line and area charts
Use line and area charts to track value trends over time. You can also use a line or area chart x-axis to represent a field
value other than time.
Data formatting
Line charts can represent one or more data series. Area charts represent multiple data series.
If a search generates multiple series, each line or area in the chart appears in a different color.
To make sure that a search generates data series correctly, check the Statistics tab below the search bar. The Statistics
table should have at least two columns for a single series, and three or more columns for multiple series.
Line and area charts get x-axis values from the first column in the Statistics table. The next table columns contain y-axis
values.
As an example, any search using the timechart reporting command generates a table where _time is the first column. A
line or area chart generated with this search has a _time x-axis.
Search results not structured as a table with valid x-axis or y-axis values cannot generate line or area charts. For
example, using the eval or fields commands might change search result structure.
Typically, line or area charts represent multiple series. Line charts can also be used for a single data series, but area
charts cannot.
Single series
A search compares the average number of bytes passed through each source. In this search, the over operator indicates
that source is the first table column.
30
In a line chart, source values are used for the x-axis. The y-axis represents avg(bytes) values.
To generate multiple data series, introduce the timechart command to add a _time field to search results. You can also
change the query to introduce a split-by field.
For example, change the previous single series search by adding clientip as a split-by field.
Configuration options
Use the Format menu to configure one or more of the following line and area chart components.
• Chart title
• Axis titles
• Null y-axis value handling. Choose one of the following options.
♦ Show null data points as a gap. The chart shows markers for any disconnected data points in this case.
♦ Connect null data points to zero data points.
♦ Connect to the next positive data point.
• Show minimum and maximum y-axis values.
• Use a logarithmic unit scale for y-axis values. This option is helpful when there is a wide range in y-axis values.
• Chart legend position and label truncation
• Enable or disable drilldown. When drilldown is enabled, users can click on a line, area, or chart legend to open a
search in a new window. The search uses values from the selected element.
If the chart represents multiple data series, you can also configure the following options.
Multi-series mode
Compare trends across multiple series. Enable the mode to show independent axis ranges for each series.
31
Stacked area charts
Stacked area charts are available when a search generates multiple data series. Stacking is not available for line charts.
Use a stacked area chart to see more details about a series and how it relates to the entire data set. Review the
comparison table here to select a stacking option.
Stack
Column or bar appearance Use case
option
Areas for different series share the same space An unstacked chart is useful for a lower number of series. As the number of
Unstacked
on the chart. series increases, the chart can become more difficult to understand.
Prerequisites
Review the following details about building column and bar charts.
• Data formatting
• Configuration options
Steps
1. Write a search that generates multiple data series. If you are building a line chart you can opt to generate a single
data series.
2. Run the search.
3. Select the Statistics tab below the search bar. The statistics table here should have two or more columns.
4. Select the Visualization tab and use the Visualization Picker to select the line or area chart visualization.
5. (Optional) Use the Format menu to configure the visualization.
Examples
Line chart
The search generates multiple data series. The line chart represents each series with a different line.
32
Area chart
Shading in an area chart emphasizes quantities. This example search tracks historical and real-time search volume over
time.
The search generates two data series. Each series appears as a different shaded area on the chart.
The search generates multiple series. Each series appears as a colored area of the stacked chart. The stacking lets you
compare the sums for different series.
33
Scatter chart
Use a scatter chart to show relationships between discrete data points. Data point distribution can show trends or
relationships across two dimensions.
Data formatting
Scatter charts work best with two data series. Use a transforming command to aggregate values. You can use the table
command with the following syntax to manage result field ordering.
Check the Statistics tab after running the search to make sure that there are three columns in the Statistics table. You
can use the table command to change the order of the columns if needed.
Configuration options
Use the Format menu to configure one or more of the following scatter chart components.
• Axis titles
• Legend placement and truncation
• Axis scale and interval values
• Axis minimum and maximum values
• Enable or disable drilldown. When drilldown is enabled, users can click on a data point or legend to open a search
in a new window. The search uses values from the selected element.
Prerequisites
Review the following details about building column and bar charts.
• Data formatting
• Configuration options
Steps
Example
An analyst creates a scatter chart to track recent earthquake locations, magnitude, and depth.
This search generates a Statistics table with three columns. The first column shows earthquake location values. The
second column represents earthquake magnitude values, plotted on the x-axis. The third column represents earthquake
depth values, plotted on the y-axis.
34
source="earthquake.csv" | table place mag depth
Use Simple XML to build more complex scatter charts. For more information see the Area, Bar, Column, line, and Scatter
Charts and Scatter chart specific properties entries in the Chart Configuration Reference.
Bubble chart
Use a bubble chart to visualize multiple series data in three dimensions. Bubble position represents two dimensions of the
data series. Bubble size represents the third dimension.
Data formatting
To create a bubble chart, start with a search that generates multiple data series. Use this syntax to generate the series.
Configuration options
Bubble chart configurations include the following options. Use the Format menu to adjust these settings.
Prerequisites
Review the following details about building column and bar charts.
• Data formatting
• Configuration options
35
Steps
Example
This search aggregates earthquake events by location. It generates data series representing the magnitude, depth, and
count for each earthquake location.
You cannot render charts using searches that do not include transforming commands, such as the following options.
chart
timechart
stats
eval
For more information, see About Transforming commands and searches in the Search Manual.
Time charting
You can only plot time-based data using the timechart command. If you try to plot a time-based series using any other
transforming search command, the chart treats the timestamp data as a series of strings.
36
Data truncation
To avoid browser performance impacts, Splunk software limits the the amount of data rendered in an individual chart.
When search results exceed limits, a message appears with the chart indicating that data was truncated.
Depending on your Splunk instance type, you can change default rendering behavior using configuration settings and/or
Simple XML. You can adjust Simple XML options in individual charts. Splunk Enterprise administrators can also add or
edit settings for all charts in the $SPLUNK_HOME$/etc/system/local/web.conf file.
Rendering Where to
In Setting Default
limit type configure
Total data points One chart charting.chart.resultTruncationLimit 50000 Simple XML
Charts in an • jschart_truncation_limit.chrome
Total data points 50000 web.conf
individual browser • jschart_truncation_limit.safari
• jschart_truncation_limit.firefox
• jschart_truncation_limit.ie11
You can adjust data truncation in individual charts using Simple XML.
You can configure the maximum number of points that can be plotted in a specific chart by editing the Simple XML for the
chart. In the <chart> element, edit the charting.chart.resultTruncationLimit property as described in Area, bar,
column, line, and scatter charts in the Chart Configuration Reference.
You can limit the number of search result data points rendered per series in a chart. Edit the charting.data.count Simple
XML setting to override the default value of 10000 data series.
Splunk Enterprise users can add or edit settings in $SPLUNK_HOME$/etc/system/local/web.conf to change rendering
behavior in all charts.
For information about editing web.conf settings, see How to edit a configuration file and the web.conf spec file in the
Admin Manual.
37
Data point limit for all charts in one or more browsers
The web.conf configuration file specifies the maximum number of points that can be plotted for charts in various browsers.
All browser limits default to 50000 data points.
Note: The charting.chart.resultTruncationLimit Simple XML option overrides this limit in an individual chart.
You can limit the number of data series that charts can render. Add or edit the jschart_series_limit setting in
$SPLUNK_HOME$/etc/system/local/web.conf to override the default value of 100 data series.
If search results exceed this limit, a chart displays only the number of series that this limit allows. A warning message
appears to indicate that the chart is showing truncated search results. For example, if the jschart_series_limit is 40 and
a search returns 50 data series, a chart renders only the first 40 series.
Limit the number of search result data points rendered per series in all charts. Edit the jschart_results_limit setting in
$SPLUNK_HOME$/etc/system/local/web.conf to override the default value of 10000 data series.
In the case of an individual chart, if the jschart_series_limit and the charting.data.count Simple XML options combine
to indicate a number greater than the jschart_truncation_limit in web.conf, then data points per series are reduced to
meet the jschart_truncation_limit setting.
For example, you might have a jschart_series_limit of 10 and a charting.data.count limit of 100 in a chart. When
multiplied, these two settings indicate a 1000 total data point limit for the chart. If the js_chart_truncation_limit is 800,
however, then data points per series are reduced to meet the 800 total point limit.
To override the js_chart_truncation limit on all charts, you can use charting.chart.resultTruncationLimit Simple
XML option to change the limit for an individual chart.
Category limit
When you are plotting data by category, Splunk software limits chart label display. This limit differs for the horizontal axis
(X-axis) and the vertical axis (Y-axis).
The X-axis must have at least 20 pixels available for each label. The Y-axis must have at least 15 pixels available. If the
requisite pixels are not available, the labels do not display.
You can zoom into the X-axis to view labels that are hidden by the category limit. See Pan and zoom chart controls for
details.
38
Single Value
Overview
Use a single value visualization to show a metric and its context. Single value visualizations display results and context for
searches returning a discrete number.
A single value can be a count or other aggregation of specific events. For instance, this visualization shows sales for a
popular lemonade stand.
A caption, unit notation, and range colors add emphasis. A trend indicator to the right of the value and a sparkline
underneath show how data has changed over time.
To start working with single value visualizations, see the following topics.
Single value visualizations work best for queries that create a time series chart using the timechart command or
aggregate data using the stats command.
This search and visualization use timechart to track daily errors for a Splunk deployment.
To access sparklines and trend indicators, it is important that the search includes the timechart command. Using
timechart means that time series data becomes available to sparkline and trend indicator processing.
39
If you use the stats command as part of a full timechart query, the visualization does not include a sparkline or trend
indicator.
If you use the stats command to generate a single value, the visualization shows the aggregated value without a trend
indicator or sparkline. As an example, this query and visualization use stats to tally all errors in a given week.
It is important to set up the single value query that best drives the visualization that you expect.
• Search for a single value to avoid unexpected results in the visualization. In the Dashboard Editor, you can select
single value visualizations even if a search returns multiple values. In this case, the single value visualization uses
the value in the first cell of the results table.
• The time range picker and the query command work together to generate the results for a single value
visualization. A query using stats results in a visualization showing the aggregated total of results in the time
range. A query using timechart generates a visualization showing the most recent result within that range.
For details about the stats command, see stats in the Search Reference.
For details about the timechart command, see timechart in the Search Reference.
A sparkline appears by default below a single value generated with the timechart command. It shows increases and
decreases in a metric over the time range you specify in a search.
This visualization shows results for a search over the past week's data. Using the time range picker to select Week to
date means that the sparkline reflects the data changes over the last seven days.
This visualization shows results for the same search over the past day's data. Using the time range picker to select Today
means that the sparkline shows data changes over the past twenty-four hours.
40
A trend indicator appears to the right of a single value generated with the timechart command. It shows recent data
behavior over a customizable time range. The trend indicator is composed of a number and an arrow to represent what
happened most recently in the data.
Depending on data behavior, the trend arrow can point up, down, or directly to the side to show no change. By default, the
trend indicator value evaluates to the difference between the two most recent values in the results. You can change the
trend time window in the Format menu's General settings panel or by adjusting the span parameter for timechart. if you
use the Compared to field in the Format menu, it will override the span command you specified in the search string. For
example:
Colors can emphasize range values or trends in a single value visualization. In the Format menu, you can choose whether
to use colors. If you opt to use colors, you can select whether to color by value or trend.
Note: For queries using stats to aggregate results, only the color by value option is available.
You can also adjust the color mode to change whether colors appear in the foreground or background.
Depending on the color mode you choose, coloring a single value generated with timechart by value means that the
sparkline and trend indicator appear black (for foreground color) or white (for background color).
Color by value
Coloring by value is available for single value visualizations generated with either stats or timechart. Color by value
means that the single numeric value in the visualization changes color based on the value the search generates and the
range for that value. For example, if you map a value range from 30-50 to the color yellow, then a single value of 35
appears yellow.
41
You can adjust value ranges for the query to change how different results are visualized. By default, there are five ranges
and colors for coloring by value. You can add or remove ranges, modify the values for each range, and change the colors
associated with each range using the Format menu.
For example, this timechart generated single value visualization shows color by value and has the background color
mode selected.
Color by trend
Coloring by trend is available for single values generated with a query including the timechart command. Coloring by
trend means that the sparkline and trend indicator in this visualization change color to show changes in data. By default,
positive changes make the sparkline and trend indicator appear green, while negative changes make them red. When
results show no change, the trend color is black.
For example, this visualization shows color by trend and has the foreground color mode selected.
You can reverse the settings for trend colors in the Format menu. You can also specify a different trend time window for
the visualization.
Existing single value visualizations might use a query with the rangemap command to configure ranges and colors.
By default, a single value visualization has this color mapping configuration for ranges.
• low: green
• guarded: blue
• elevated: yellow
• high: orange
• severe: red
Caution: As support for the rangemap command is limited, it is not recommended for building new single value
visualizations. Queries using rangemap currently generate a single value, but UI configurations override the query-based
settings.
For existing single value visualizations, it is recommended to migrate rangemap command settings out of the query.
Replace query-based settings with equivalent range and color settings in the Format menu Color panel.
Use the Format menu's General options panel to add a caption for a single value visualization. You can specify a unit of
measurement and its position in the Number Format panel. For instance, you can add $ before a value reflecting sales in
the United States or MB after a value tracking data transfers.
42
Note: If you are migrating from earlier versions of Splunk software and your visualization includes Before and After labels,
the Format menu shows prompts to update label and unit text using the Unit and Caption fields.
Captions
Captions add descriptive context to a single value visualization. To add a caption, select the Format menu General panel.
Use the caption text field here to enter a description. Captions appear below the single value.
Units
Units can indicate standard measurements for single values. To add a unit to the visualization, select the Format menu
Number Format panel and edit the Unit field. You can choose whether a unit appears before or after the value. It is
recommended to keep unit text to five characters or fewer. Use a caption for longer text.
Number formatting
If you are working with a large single value or one that requires precision, you can change the number formatting for the
visualization. In the Format menu Number Format panel, you can choose thousand separators or different degrees of
decimal precision.
Drilldown
By default, drilldown is disabled for single value visualizations. You can enable drilldown functionality using Simple XML.
For more information about drilldown, see Drilldown behavior in this manual.
43
Gauges
Using gauges
Use a radial, filler, or marker gauge to map a value in relation to a range. A gauge visualization provides metric status and
range information that you can interpret quickly. You can use a real-time search to generate a gauge tracking value
fluctuations as they occur.
Data formatting
To generate a gauge, use a search that returns a single numerical value. For example, use a search that returns an event
count for events with a specific field value in a time period or real-time window. If you are using a real-time search, the
range marker moves to show the metric changing over time.
Gauge types
Radial gauge
A radial gauge includes a round value scale and a pointer to show the current value on the scale. The current value also
appears at the bottom of the gauge. You can configure a radial gauge to use specific colors for each value range in the
scale.
If the search generates a current value outside of the configured minimum or maximum range, the gauge pointer bounces
at the lower or upper end of the value scale.
Filler gauge
44
A filler gauge includes a value scale container that fills and empties as the current value changes. The fill level shows
where the current value is on the value scale.
The current value also appears inside the filled portion of the gauge. The container appears empty for a value lower than
the minimum and full for a value higher than the maximum.
Marker gauge
A marker gauge shows value ranges and colors with a marker that moves to indicate the current value.
If the search generates a current value outside of the configured minimum or maximum range, the marker bounces at the
lower or upper end of the value scale.
Configuration options
Use the Format menu to configure gauge style and color ranges.
Color ranges
Use the Format > Color Ranges panel to select manual or automatic color range configuration. By default the first three
ranges are green, yellow, and red.
Set the Color Ranges handling to Automatic if the query includes the gauge command for range configuration.
If the query includes gauge, Format menu range configurations override the gauge command settings in the query.
Prerequisites
Review the following details about building column and bar charts.
• Data formatting
• Gauge types
45
• Configuration options
Steps
46
Maps
Mapping data
There are several options for visualizing data that includes geographic information.
A Choropleth map uses shading to show relative metrics, such as population or election results, for predefined geographic
regions. For example, this image shows a map of the United States. States have lighter or darker shades of two different
colors. One color represents low values for a particular metric. The darkest shading in this color represents the lowest
values. The other color represents high values for the same metric. The darkest shading in this color represents the
highest values. Shading fades as the values approach the middle of this range.
You can also create other visualizations with geographic data, such as cluster maps or charts.
Getting started
Use the following topics to learn about creating Choropleth maps and other geographic visualizations.
See also
To learn about geospatial lookups, see Configure geospatial lookups in the Knowledge Manager Manual.
Choropleth maps have specific data and component requirements. A search uses the data and components to generate a
Choropleth map.
47
Use normalized data
Choropleth maps work best when data is normalized. Normalization adjusts data to more accurately reflect the metric that
you are visualizing. For example, a Choropleth map can compare sales performance in two cities with significantly
different populations. Using normalized data to generate this map means that the population difference alone does not
determine how the cities' sales compare on the map.
These components are required for creating geographic visualizations. Check the following table before running a search.
Either:
A lookup table file defines region boundaries, such as the
• Built-in files for the United States,
boundaries of each state in the United States.
geo_us_states, and countries of the
Lookup table file
world, geo_countries.
From the Search and Reporting home page, select Settings >
• Upload a KML or KMZ file for other
Lookups > Lookup table files to review available files.
places. Upload the file to the Lookup
table files manager page.
Either:
A geospatial lookup matches coordinates to region definitions in
• Built-in lookups for the United States and
the lookup table file.
for world countries.
Geospatial lookup
• Create a geospatial lookup. For more
From the home page, select Settings > Lookups > Lookup
information, see Configure geospatial
definitions for available lookup definitions.
lookups in the Knowledge Manager
Manual.
A search coordinates data, a transforming search, and a geospatial lookup to build a Choropleth map or other geographic
visualization. The following steps show you how to create a Choropleth map search. Optionally, you can use the steps to
generate other visualizations for geographic data.
Prerequisites
Make sure that you have the correct data and components for building a geographic visualization. See Data and
component requirements.
Steps
Run each portion of the search as you build it to ensure that it is working correctly. Depending on the visualization you are
creating and the components that you have, some steps are optional.
48
1. Indicate an events data source.
source=my_data.csv |
Start with an events data source that has signed degree geographic coordinates or location name fields. For
example, here is one record in a .csv file listing retail locations for a business. This file includes latitude and
longitude coordinates for each record.
Store Number,Name,Facility ID,Products,Services,Country,Latitude,Longitude
12345,Buttermilk Tea Shop,54321,"Tea, Cake",Wi-Fi,US,43.031873,-71.073203
The lookup uses the geographic coordinates to generate featureId and featureCollection fields for events. A
featureId is the name of a geographic feature that includes a particular set of geographic coordinates, such as a
state or city name. By default, the featureCollection is the lookup definition name.
After adding the lookup and running the search, check the available Selected Fields or Interesting Fields to
ensure that featureId is listed. If it is not, then the lookup did not generate the featureId from the geographic
coordinates. Fields are case-sensitive.
Depending on whether the events include a featureId field, select one of the following options.
Events have Next steps Example
1. Use the lookup to which those fields
featureId fields geom geo_us_states
belong.
49
For more information and advanced options for Choropleth map queries, see geom in the Search Reference.
Example search
The full search assembled in the previous steps looks like this.
source=my_data_source.csv
| lookup geo_us_states longitude as Longitude, latitude as Latitude
| stats count by featureId
| geom geo_us_states
Configure a Choropleth map
To review or change Choropleth map configuration, select the Format menu and one of the following settings panels.
General
Adjust general settings including drilldown, initial geographic coordinates, and zoom on scroll.
Colors
Color mode and data bin settings determine how a Choropleth map uses color to visualize data. Select a color mode and
configure data bins in the Colors panel.
Color modes
Color
Description and use cases Example
mode
Color regions by category value. For example, you can track top product purchases by state. If
Categorical
multiple states have the same top product, they share a color.
Color regions with light to dark shades of a single hue. This mode helps you find regions where a
Sequential
metric is particularly high.
Color regions in light to dark shades of two distinct hues. This mode shows regions where a
Divergent metric is particular high or low. Shading fades as regional metrics approach the middle of the
range.
50
Data bins
Aggregated data values are divided into a set of bins. Each bin corresponds to a specific value range and has a unique
color or shade. You can adjust the number of bins and bin color assignments for the selected color mode.
The Choropleth map legend to the right of the map shows bins with their colors and value ranges.
Shapes
A shape corresponds to an individual region on a Choropleth map. For example, each state in a Choropleth map of the
United States is a shape. You can adjust shape opacity and borders.
Tiles
Tiles represent map background features, such as oceans. Show or hide tiles.
Cluster maps
Use the cluster map visualization to plot aggregated values on a map.
51
Data formatting
To generate a cluster map, use the geostats command. The geostats command generates events that include latitude
and longitude coordinates for markers. It is similar to the stats command, but provides options for zoom levels and cells
for mapping.
Configuration options
Use the Format menu to adjust the following cluster map components.
Drilldown
You can also enable or disable cluster map drilldown in the Format menu.
Cluster map drilldown lets users open a secondary search by clicking on a map cluster. The secondary search uses the
geographic boundaries of the selected cluster.
Example
The following search generates a map showing California earthquakes of magnitude greater than 3 for the past 30 days.
52
When a user clicks on a cluster indicating earthquake data, a search launches using the latitude and longitude boundaries
of that cluster.
53
Get Started with Dashboards
Dashboard overview
Create new dashboards or edit existing ones.
For a quick glance at the most common use cases and commands for creating dashboards, note that you can access the
Splunk Dashboards Quick Reference guide by clicking the link in Getting started.
Build dashboards
Edit dashboards
For more information on using Simple XML, see Editing Simple XML
For more information on event handlers and tokens, see Use drilldown for dashboard interactivity and Token usage in
dashboards
54
Tools and frameworks
To build and edit dashboards, use one or more of the following tools and frameworks.
Build and edit dashboards using the Splunk Web user interface.
Simple XML
Dashboards use Simple XML source code to define their content and behavior. You can use the dashboard editor in
Splunk Web to edit this source code.
Developer options
For more information, see the following Splunk developer portal resources.
Dashboards converted to HTML have some editing limitations in Splunk Web. They also cannot be exported to PDF.
Examples
The Dashboard Examples app on Splunkbase provides many dashboard implementation examples, including source
code. Install the app to view and interact with the example dashboards.
Deprecated options
55
About the dashboard editor
Use the Splunk Web dashboard editor to create and edit dashboards. The dashboard editor provides access to an editing
user interface and Simple XML source code.
You can create and update dashboards and panels in the editor user interface.
Use the dashboard editor to access and edit Simple XML source code.
The editor provides validation, error messaging, and warnings as you make changes.
Keyboard shortcuts
Keyboard shortcuts consistent with Ace code editor shortcuts are available in the dashboard editor.
You can format Simple XML source code by using Command + Shift + F on a Mac or CTRL + Shift + F on Windows.
56
Build and Edit Dashboards in Splunk Web
Create a dashboard
Dashboards are created in the context of a particular app. For example, if you are using the Search and Reporting app,
dashboards use this app context.
After you create a dashboard, you can modify its permissions to share or manage access for other users. You can also
modify the app context.
Steps
Inline panel
An inline panel contains a search. The search generates the results rendered in the panel visualization. You can edit an
inline search directly using the dashboard editor.
57
Panel from a report
You cannot modify the search string in the panel, but you can change and configure the visualization. If the report search
changes, the panel using that report updates accordingly.
Depending on your permissions, you can control whether the report is accelerated, scheduled, and embedded. You can
also change the report permissions.
Reports in dashboard panels can run as the report owner or the report user. These settings can affect data visibility and
concurrent search limits.
Back dashboard panels with scheduled reports whenever possible to reduce search processing load for your Splunk
deployment.
Not using scheduled reports can impact search processing loads and concurrent search limits. For example, If fifty users
access a particular dashboard, panels not backed by scheduled reports cause their reports to rerun fifty times.
Scheduled reports do not require the search to run each time a user loads the dashboard. Panels backed by scheduled
reports show results from the last scheduled run of the report.
To show dashboard users the most current results, back dashboard panels with real-time scheduled reports. This report
type runs in the background at all times. It does not launch a new report instance each time a user loads the dashboard.
Instead, it shows results for the currently running real-time scheduled report.
58
Prebuilt panel
Save and reuse Simple XML panels in multiple dashboards. You can display a prebuilt panel in a dashboard by using a
reference to the panel. Edit the panel directly to change the title, search, or visualizations in it.
Additional information
• To learn about using the dashboard editor to add or edit dashboard panels, see Add panels to dashboards.
• For more details on panel searches, see Searches power dashboards and forms.
• See Edit dashboards and Edit visualizations to learn more about editing panel visualizations.
• To learn about working with reports, see Create and edit reports and Schedule reports in the Reporting Manual.
To learn about types of dashboard panels, see Working with dashboard panels.
Add panels to a dashboard with the dashboard's Edit menu. Access the Edit menu directly from the dashboard or from
the list of dashboards on the Dashboards page.
Use filters in the search field to locate or create specific panels. The search looks for specified terms in existing
dashboards, panels, and reports. It provides results for new panels using the specified search terms, and links to existing
dashboards and panels containing the terms.
The following tips can help you with searching and filtering.
• Use visualization element names, input types, chart types, and other keywords to filter a search. For example:
59
♦ Search for map to return results to dashboards implementing a map visualization or to create a new panel
with the map visualization.
♦ Search for multiselect for results with a multiselect form input.
• You can filter for multiple items, but all items must appear in the order that you specify in the search field.
1. If you are not in edit mode for the dashboard, select Edit.
2. Select a panel and drag it to its new position.
When you create an inline panel, you select a visualization and specify a search for the panel.
When you create a panel from a report, you select from a list of available reports.
You can clone a panel from another dashboard. The panel appears on your dashboard with the same editing capabilities
as the cloned panel.
60
Create and add a panel by reference
You can create a panel that you can later add to dashboards by reference. This prebuilt panel is useful if you plan to
reuse it often in various dashboards.
There are two ways to create a panel that you can reference from other dashboards.
Typically, you create the panel using the dashboard editor, and then convert it to a prebuilt panel. You can also create the
panel in simple XML code.
You can convert a panel to a prebuilt panel only if the panel does not contain a post-process search. A post-process
search is a search that uses the base attribute to reference another search.
1. In the dashboard containing the panel that you want to convert, select Edit > Edit Panels.
2. From the Options Menu for a panel, select Convert to Prebuilt Panel.
3. (Optional) In the dialog that opens, specify the following details.
♦ ID: The filename for the panel. Only alphanumeric characters, '-' character, and '_' are allowed.
♦ Panel Permissions: Select either Private or Shared in App.
Private: Only you have permissions to view and edit the panel.
Shared in App: The panel is available to view and edit by other users of the app.
If this is your first time working with Simple XML, see Editing simple XML. See also the Simple XML Reference for more
information on panel configurations.
1. From Splunk Web, go to Settings > User Interface > Prebuilt Panels.
2. In the Panels page, select New to open the Simple XML Editor.
3. In the Simple XML Editor, specify the following:
61
Convert a prebuilt panel to an inline panel
You can convert a prebuilt panel to an inline panel. The prebuilt panel cannot contain a post-process search. A
post-process search is a search that uses the base attribute to reference another search.
The conversion of a prebuilt panel to an inline panel lets you customize the search and visualization.
You can specify a title when creating a panel. You can also use the dashboard editor to change panel titles, with one
exception. Prebuilt panel titles cannot be edited in the dashboard editor. See Edit a prebuilt panel for more information.
Steps
Option What to do
1. Next to Edit Dashboard at the top left of the page, make sure that the UI editor is selected.
Editing user interface
2. Click the panel title that you want to edit and change the text.
1. Next to Edit Dashboard at the top left of the page, make sure that the Source editor is
selected.
Edit Simple XML
2. Locate the <title> element inside the <panel> that you want to edit.
3. Change the panel title text.
4. Click Save.
Use the Prebuilt Panels page to access a panel source code editor.
Steps
1. From the home page, navigate to Settings > User Interface > Prebuilt Panels.
2. Locate the panel that you want to edit and select Edit.
3. Edit the Simple XML source code.
4. Click Save. The panel is updated in dashboards that include it by reference.
You can delete a panel from a dashboard using the Dashboard Editor or by editing the simple XML code.:
• From the Dashboard Editor, in panel-editing mode, click the Options menu for a panel and select Delete.
Or you can click the Delete icon, X, which is in the upper right corner of the panel.
62
• In simple XML source code, delete the <panel> element and its contents.
Edit dashboards
Use the dashboard editor to customize dashboard panels, layout, or add interactivity.
1. From the Dashboards listing page, open the dashboard that you want to convert.
2. Click Edit to open the dashboard editor.
3. Select UI or Source to change the editing mode.
4. (Optional) Preview dashboard edits as you make them and click Save to save changes. Click Cancel at any point
to discard changes.
You can change dashboard layout to prioritize specific panels or make room for additional content.
1. From the Dashboards listing page, open the dashboard that you want to convert.
2. Click Edit to open the dashboard editor.
3. Drag and drop panels to reposition them.
All search
Reports Inline searches and inline pivots
types
1. From the Dashboards listing page, open the dashboard that you want to edit.
2. Click Edit to open the dashboard editor.
At the top right of each panel, editing icons appear. The first editing icon represents the search for the panel. The
search icon varies to represent the type of search being used.
3. Select the search icon to view configuration options for the search.
4. Select the search configuration that you want to change. Depending on the option you select, additional
63
configuration dialogs or windows might open.
5. After editing the search, click Save to save changes to the dashboard.
Use the dashboard editor to edit a panel visualization for panels that are not generated with pivot or pivot report searches.
If you are working with visualizations generated from pivot or pivot report searches, you can use the Pivot Editor. See
Design pivot charts and visualizations with the Pivot Editor for details.
Prerequisites
• Review Data structure requirements for visualizations for details on generating search results in the correct format
for a visualization.
• See Properties available from the Visualization Editor to review visualization configurations.
Steps
1. From the Dashboards listing page, open the dashboard that you want to edit.
2. Click Edit to open the editing dashboard.
At the top right of each panel, editing icons appear. The second icon represents the Visualization Picker. The icon
varies to represent the visualization type. The third editing icon represents the visualization Format menu.
3. (Optional) Use the Visualization Picker to select a different visualization. Make sure that the panel search
generates results in the correct format for the new visualization. You can select any visualization, but the panel
search results might not render if they are not formatted for the selected visualization.
4. (Optional) Use the Format menu to configure the visualization.
5. Click Save to save changes to the dashboard.
Edit dashboard Simple XML source code to customize settings that are not accessible from the user interface. The
dashboard source code editor provides interactive validation as you make updates.
Prerequisites
• For information about editing Simple XML source code, see About editing Simple XML.
Steps
1. From the Dashboards listing page, open the dashboard that you want to edit.
2. Select Edit to open the dashboard editor.
3. Click Source to open the dashboard XML source code editor.
4. Edit the source code.
5. (Optional) Observe that the editor provides automatic tag closing and validation. The editor displays validation
warning or error messages as needed. Hover over a warning or error icon next to a line of source code to view
64
the message for that line.
6. (Optional) Validation warnings and errors disable the Save button. If the button is disabled, correct any code with
validation warnings or errors.
7. If there are no warnings or errors, the Save button is enabled. Click Save to save the source code edits.
Prebuilt panels cannot be edited in the dashboard editor. Use the Prebuilt Panels page to access a panel source code
editor.
Steps
1. From the home page, navigate to Settings > User Interface > Prebuilt Panels.
2. Locate the panel that you want to edit and select Edit.
3. Edit the Simple XML source code.
4. Click Save. The panel is updated in dashboards that include it by reference.
Additional resources
Edit visualizations
Edit a visualization to configure its search, type, appearance, and behavior.
You can edit visualizations in the dashboard editor or on the Search page. In either location, you can adjust the following
visualization components.
Visualization
Description
components
Search string Use the dashboard search editor or the search bar to change the query driving the visualization.
Use the Visualization Picker to select a visualization type. Ensure that the query generates results in the proper
Type
structure for the selected visualization.
Format and behavior Use the Format menu to adjust appearance, drilldown, and other settings for the visualization's user interface.
Caution: Changing visualization settings in the dashboard editor can overwrite related token settings and behavior. If you
are using tokens to configure part of a dashboard or form, use caution when updating related elements in the dashboard
editor. For example, if a form input configures chart legend placement, selecting a legend placement in the Format menu
overwrites the dynamic token setting from the input. In this case, the input remains in the dashboard but no longer
configures legend placement.
65
Visualization editing workflow
The workflow for editing a visualization search, type, or format is slightly different depending on whether you are editing in
the dashboard editor or the Search page.
Write permission is required for editing dashboard panels. By default, you have write permission for any dashboard that
you create. However, you might have read-only access to other dashboards. Users with the admin role can change editing
permissions.
Click on the dashboard name to view it. After the dashboard opens, select Edit.
3. In the panel you are editing, locate the icons for editing the search, visualization type, and format. Select the icon
for the component you are editing.
4. Edit the selected visualization component.
Format menu Change the visualization format and behavior. Format options vary by visualization type.
Search bar Edit the query and rerun it to refresh the visualization.
• Each edit that you make is saved to the visualization. You can see each change in the visualization and make
adjustments as you go.
• Edits are reflected in the dashboard Simple XML source code as they are made.
• Click and drag the Format menu to move it anywhere on the screen.
• Close the Format menu or click anywhere outside of it to exit and save changes.
66
Additional resources
Formatting and other options vary by visualization type. To compare visualizations, see the Visualization reference. See
also Chart Configuration Reference.
For information on using Pivot to edit visualizations, see Design pivot charts and visualizations with the Pivot Editor.
The typical workflow for creating forms includes the following steps. Some steps are optional and you do not have to
complete them in this order.
Forms are dashboards with interactive user inputs for selecting or filtering content. When you add an input to a
dashboard, the top-level source code element changes from <dashboard> to <form>.
Steps
1. From the Dashboards listing page, open the dashboard that you want to convert.
2. Click Edit to open the dashboard editor.
3. Select one or more inputs from the Add input list. As soon as you select an input, the dashboard is converted to
a form.
4. (Optional) Drag and drop inputs to rearrange them.
5. (Optional) Drag an input into a specific panel. Use tokens to make the input control only this panel.
6. Click Save to save changes to the form.
When you add an input to a form, a unique token is generated for the input. You can use this token to change panel
content based on what users select. For example, use a token in the panel search to modify the results that the panel
visualization shows. Or, change the panel label or drilldown behavior using the token.
The following examples show you typical options for using tokens in a form input.
67
Reference a token in a search
In this example, a dashboard has one panel. The panel search aggregates events for all sourcetypes.
Add interactivity by converting the dashboard to a form. Add a text input to let users specify a sourcetype to filter the
events in the visualization.
The form now contains a text input for users to specify a sourcetype to show in the visualization. Before users specify a
sourcetype, the visualization does not render because the token has not captured a value to use in the search. After a
sourcetype is entered in the text field, the search uses this value to generate results and the visualization renders.
A time input lets users apply a time range to filter the events shown in one or more panels.
Add the time input and update panel searches to incorporate the user specified time range.
1. From the dashboard or form, click Edit to open the dashboard editor.
2. Select Add Input > Time.
3. (Optional) Select the input editing icon and update the input label and token name.
4. (Optional) Click Apply to save the input updates.
5. For each panel where you want the time input to apply, make the following changes.
1. Click the search editing icon.
2. Select Edit search.
3. For Time Range Scope select Shared Time Picker. If there is more than one time input in the form,
each shared time picker is listed with the unique token for its time input. Select the shared time picker that
includes the token for the input that you want to use.
6. Click Save to save the panel search updates.
7. Click Save to save the form updates and exit the dashboard editor.
A form can have one or more time inputs. Depending on the behavior you want, a time input can be used globally for all
panels or only for specific panels.
68
Global time picker
When you create a time input using the dashboard editor, a token is generated automatically for the input. If you delete
this token, the time input becomes global. Each panel in the form that does not specify a time range or another time input
uses the global time picker.
When configuring a panel search time range, you can select Shared Time Picker (global) to apply this input.
To submit token values when the page loads, enable autorun behavior.
By default, inputs are configured to submit token values whenever users make a new selection. To change this behavior,
follow these steps.
Add a Submit button to a form to let users control when input selections are submitted. This can be helpful for managing
how often panels or forms with multiple inputs update. Typically, Search on change is disabled for inputs if you use a
"Submit" button in the form.
69
Specify initial and default input values
Default
Use a default value for an input when users do not make a selection.
Initial
Use an initial value for text inputs only. The initial value appears only when the form page loads. If a user clears
the text field, the initial value does not reappear and the token value is set to an empty string.
If you specify both an initial and default value for a text input, only the default value applies.
Several form input types can include multiple static or dynamically populated options.
• check box
• dropdown
• link list
• radio
• multiselect
All of these inputs display multiple options, while multiselect and check box inputs let users choose multiple values. The
following tasks show you how to configure options for each of these inputs.
The following example shows you how to specify multiple static options. The example uses a dropdown input but it applies
to any multi-option input.
70
These steps show you how to configure a dynamically populated dropdown. They do not include steps for updating the
search to use the token value from the input.
1. From the dashboard or form, add a line chart panel that uses the following search.
index=_internal | timechart count
2. Add an input to let users filter the panel visualization for a particular sourcetype.
♦ Click Edit to open the dashboard editor.
♦ Select Add Input > Dropdown.
3. Configure the input.
♦ Select the input editing icon.
♦ Select Dynamic options.
♦ Add the following search to generate input labels and values.
index=_internal | stats count by sourcetype | eval label=sourcetype." (".count.")"
♦ Observe that the search aggregates events by sourcetype and generates a label field that combines
sourcetype names and event counts.
♦ Use the search result fields for input labels and values. Specify the following fields. Field for Label: label
Field for Value: sourcetype
4. Click Apply to save input updates.
5. Click Save to save form changes.
Users can now view sourcetype names and event counts in the dropdown.
Multiselect and check box form inputs let users select multiple values.
This example panel includes a check box for users to specify sourcetypes to render in the chart.
71
Search to generate multiple selected values
To handle one or more user selected values in a multiselect or check box, use a search that generates results for one or
more values.
To specify the source type values in the above form, build a search string indicating the values to return. For this example,
the following search string allows the selection of multiple values for source types:
The search driving the panel accesses the token value of check box and multiselect differently than the other form inputs.
Use the submitted modifier to the token.
The Input Editor provides editing fields to specify multiple values for selection in a check box or multiselect. The table
below describes these fields and provides example values that build the following search string:
Editor Example
Description
Field Values
String prefixed to the value of the input element.
Token Prefix (
For multiple selections, this is typically an open parenthesis to enclose the string
selecting the values.
String prefixed to the value of the input element. Can be a regular expression.
Token Value Default value is an opening double quote (").
sourcetype="
Prefix
Typically, this is the opening part of a sub-string that selects the multiple values.
"
72
Editor Example
Description
Field Values
Token Value String appended to the value of the input element. Can be a regular expression.
Suffix Default value is an closing double quote (").
Typically, this is the closing part of a sub-string that selects the multiple values.
A string placed between each selected value. Typically, you specify " OR " or "
AND " using upper case. Do not specify the quote marks, but specify a space
character before and after the string.
Delimiter OR
Default value: " "
Default value does not include quote marks. The quote marks show that the
default value is a space character.
The following procedure shows how to enable multiple selections for a check box or multiselect input.
This section provides an example of each form input, with a list of the key fields for implementing the example.
Check box
This example uses the check box input to indicate which source types to display in a timechart. A populating search
specifies the available options to select. Three source types are selected by default:
splunk_web_access
splunk_web_service
splunkd
This example enables Search on Change. The form loads when a selection is made.
The panel displays results in the default column chart, using the following base search. The visualization references the
input values using the value specified for Token. In this example, the token name is src_type_tok.
73
General settings
Specify the Label for the input and the Search on Change behavior. This example enables search on change.
Token options
Use the Token Options to specify the value returned by the check box input.
For the Token field, specify a name for the token that returns the value. The base search for the visualization references
this token. In this example, specify src_type_tok.
Use the following fields to build the search for the returned value. The Preview field in the Input Editor updates as you edit
these fields.
• Token Prefix
• Token Suffix
• Token Value Prefix
• Token Value Suffix
• Delimiter
The example values listed in the table below build the following search string:
After you dynamically create the check boxes, from the Default field, select the check boxes that are enabled by default.
Static options
Use the static options to explicitly define the Name and Value of the check boxes for the input.
This example leaves the static options blank. It uses a populating search to define the check boxes for the input.
Dynamic Options
Reference a report or define an inline populating search to define the check boxes for the input.
74
The example runs the search against all time.
Use field names to specify a name/value pair for the check boxes. This example specifies the sourcetype field for both
Field for Label and Field for Value.
This table lists the example values for the check box input example.
Token Options
Token src_type_tok
splunk_web_access
Default splunk_web_service
splunkd
Token Prefix* (
Token Suffix* )
Delimiter* OR
Dynamic Options
*These fields build the search string that dynamically create the check boxes. For the Delimiter field, be sure to
specify an opening and closing space.
Dropdown input
This example uses a dropdown input to indicate which source types to display as a time chart. The panel displays results
as a bar chart, using the following base search.
75
The example uses static options to define choices for the dropdown.
The example specifies splunk for Token Prefix. Each selected value prefixes the token prefix to the value.
The example relies on a Submit button to run the search. Changes to the selection do not apply until you click the Submit
button.
Token Options
Token src_type_tok
Default Daemon
Static Options
This example uses a multiselect input to indicate which source types to display in a timechart. The panel displays results
in the default column chart, using the following base search.
76
The example uses static options to define choices for the dropdown.
Daemon
Web Access
This example enables Search on Change. The form loads when a selection is made.
For a multiselect input, you define multiple values to select by building the following search string.
The token $src_type_tok$ references this search string in the search that drives the panel contents. The fields that build
the search string are indicated in the table below.
Token Options
Token src_type_tok
Daemon
Default
Web Access
Token Prefix* (
Token Suffix* )
Delimiter* OR
Static Options
77
Editor Field Example Values
Name : Value Web Access : splunk_web_access
*These fields build the search string that supplies the token value. For the Delimiter field, be sure to specify an
opening and closing space.
Radio input
This example uses a radio input to indicate which source types to display as a time chart. The panel displays results as an
area chart, using the following base search.
The example uses static options to define choices for the dropdown.
This example enables Search on Change. The form loads when a selection is made.
Token Options
Token src_type_tok
Static Options
78
Text input
This example uses a text input to indicate which source types to display as a time chart. The panel displays results as a
pie graph, using the following base search.
The token $src_type_tok$ references the values specified in the text input.
This example specifies an initial value of splunkd* without specifying a default value. Upon initial load, the seed value is
applied. The form reloads when you specify a new value.
Because there is no default value, an empty text input does not return any results.
Token Options
Token src_type_tok
Initial splunkd*
Time input
This example shows how to use a time input to specify time ranges for a panel in a form. The form contains a radio input
to indicate which source types to display as a time chart. The panel displays results as a column chart, using the following
base search.
79
The examples specifies time_input_tok to reference the time input in a panel.
In the Panel Editor, select Edit Search String. From the Time Range Scope dropdown, select Shared Time Picker
(time_input_tok).
The example enables Search on Change for the time input. The form loads when a new time range is selected.
Token Options
Token time_input_tok
Learn about creating and editing HTML dashboards on the Splunk developer portal.
• See Convert Simple XML dashboards to HTML for information and procedures.
• See About file precedence and caching to learn about caching and refreshing Splunk assets, including HTML
files.
80
Create Dashboards with Simple XML
Edit dashboard Simple XML source code to customize settings that are not accessible from the user interface. The
dashboard source code editor provides interactive validation as you make updates.
Prerequisites
If you are unfamiliar with Simple XML, review the following information before you edit source code.
Steps
1. From the Dashboards listing page, open the dashboard that you want to edit.
2. Select Edit to open the dashboard editor.
3. Click Source to open the source code editor.
4. Edit the source code.
The editor provides automatic tag closing and validation. It also displays warnings or error messages as needed.
Hover over a warning or error icon next to a line of source code to view details.
5. If the Save button is disabled, correct any code with validation warnings or errors. Otherwise, click Save to save
your edits.
Some characters have special meaning in Simple XML files. To prevent the source code parser from treating them as
special characters, wrap them in <![CDATA[]]> tags.
<![CDATA[
<content_with_special_characters>
]]>
You can also escape these characters using HTML entities.
HTML
Character Description
Entity
' apostrophe '
81
HTML
Character Description
Entity
< left angle bracket <
Access a read-only version of dashboard source code by appending the showsource query parameter to the dashboard
URL. See the following example.
https://host:port/en-US/app/my_app/my_dashboard?showsource
Note: Read-only source code access is available only for Simple XML dashboards. Read-only HTML or Advanced XML
source code is not accessible using the URL.
Additional information
• Simple XML dashboard and form structure in Anatomy of dashboards and forms.
• The Simple XML Reference and the Chart Configuration Reference provide details on Simple XML elements and
options.
Splunk Enterprise users can edit Simple XML using a third-party editor. This option is not available in Splunk Cloud
Platform. See Using a third party XML editor.
There are several ways to access searches that drive the content of a dashboard.
Inline searches
You can provide inline searches that are global to a dashboard or provide inline searches for each visualization in a
dashboard. Searches that are global to a dashboard require post-process searches in visualizations. The post-process
searches further modify the data returned from the global search.
82
Searches saved as reports
You can save a search as a report and access the search in a dashboard by reference to the report. See Create and edit
reports in the Reporting Manual for details.
Use Pivot to generate searches as pivots that you can export to dashboards. For more information, see the Pivot Manual.
The chapter Design pivot tables with the Pivot Editor provides details on building and exporting pivots as searches.
You can use searches to dynamically populate choices for form inputs such as radio buttons, drop-down lists, and check
boxes.
Searches can access tokens, a type of variable that references search fields and their values. In the search command,
surround a field with $...$ characters to define a token. In the code snippet below, a token had been previously defined
with $series_tok$.
Use the token in a form to accept user input and to display labels and titles in dashboards. The Basic form example shows
how to use tokens within forms. See also Token usage in dashboards.
Use the <search> element and its child elements to define searches in simple XML. The <query> element provides the
actual search string. The <earliest> and <latest> elements provide the bounds of the search.
• A search that provides the labels and value for inputs such as a radio input or dropdown input.
See the Search element in the Simple XML Reference for details on writing searches in simple XML code.
83
Search examples in simple XML
This topic provides examples of using the <search> element in the following contexts:
• Inline search.
• Reference to a search from a report.
• Populate choices for an input.
• Post-process searches that access a global search.
• <query>
Provides the search string.
• <earliest> <latest>
Define the bounds for the search.
84
<dashboard>
<label>Visualization with inline search</label>
<description></description>
<row>
<panel>
<chart>
<title>Radial gauge</title>
<search>
<!-- Inline search query -->
<query>
index=_internal source="*splunkd.log"
( log_level=ERROR OR log_level=WARN*
OR log_level=FATAL OR log_level=CRITICAL )
| stats count as log_events
| rangemap field=log_events low=1-100 elevated=101-300 default=severe
</query>
<option name="charting.chart">radialGauge</option>
<option name="charting.chart.rangeValues">[0,300,600,900]</option>
</chart>
</panel>
</row>
</dashboard>
Reference a search from a report
You cannot modify the search from the dashboard, but you can modify the time bounds and the visualization for the
search results. If the search in the report changes, the visualization based on that report updates to include the changes.
You can also reference a scheduled report in a dashboard panel. When the dashboard loads, panels backed by
scheduled reports load instantly with the results from the last scheduled run of the report. This practice can improve the
dashboard user experience in cases where you have searches that ordinarily take a long time to run. It can also reduce
the search processing load on your system if you have dashboards that are loaded frequently by large numbers of users.
See "Add panels to dashboards" in this manual.
The report in this example uses a bar chart for the visualization and displays results for the last seven days. The panel on
the left displays the search from the report. The panel on the right uses the same search from the report, but modifies the
time bounds and visualization.
85
<dashboard>
<label>Search from report</label>
<row>
<panel>
<title>Original report</title>
<chart>
<title>Source types time chart</title>
</chart>
</panel>
<panel>
<title>Modified time bounds and visualization</title>
<chart>
<title>Source types time chart</title>
</search>
</chart>
</panel>
</row>
</dashboard>
Populate choices for form inputs
Use the search element to dynamically populate the choices for the following form inputs:
• Check boxes
• Drop-down list
• Multiselect input
• Radio buttons
Caution: Do not use a real-time search for a populating search. The input choices do not update correctly when
using a real-time search.
86
The search in this example compares static and dynamic definition for choices. The drop-down list uses a populating
search to define the choices.
• Populating <search>
Returns fields to use for the label and value of the choices.
• <fieldForLabel> <fieldForValue>
Child elements to the <input> element. These elements specify the fields to use to populate choices for the
dropdown.
<form>
<label>Populate an input with a search</label>
<description>Events Filtered by User and Sourcetype</description>
<!-- Do not need a Search Button. Inputs search when changed -->
87
<suffix>"</suffix>
</fieldset>
<row>
<panel>
<!-- Use tokens from the <input> elements in the panel title -->
<title>
Input selections: (radio) "$username_tok$", (dropdown) $sourcetype_tok$
</title>
<chart>
</panel>
</row>
</form>
Post-process searches
Sometimes you end up with a dashboard running searches that are similar. You can save search resources by creating a
base search for the dashboard. Panels in the dashboard use a post-process search to further modify the results of a base
search. The base search can be a global search for the dashboard or any other search within the dashboard.
Typically, the global search is a transforming search. A transforming search uses transforming commands to
transform event data returned by a search into statistical data tables. See transforming commands and searches in the
Search Manual.
Be aware of the limitations for post-process searches that arise from the following causes:
See Post process limitations for details on these limitations and other cautions about using post-process searches. The
topic Post-process examples provides guidance on constructing post-process searches.
88
Post-process limitations
Post-process searches have limitations. If you do not use a transforming base search, these limitations can cause data
truncation or performance issues.
Note: This search result retention limit matches the max_count setting in limits.conf. This setting defaults to
500,000.
Timeout
If the post-processing operation takes too long, it can exceed Splunk Web client's non-configurable timeout value of 30
seconds. This can result in a timeout due to an unresponsive splunkd daemon/service. This scenario typically happens
when you use a non-transforming search as the base search.
Avoid using a base search without transforming commands. If a base search returns raw events in excess of event
limitation, incomplete data might be passed to post-process searches. Use transforming commands in the base search to
avoid the event limitation. See About transforming commands and searches in the Search Manual.
Avoid post-process searches that reference fields not named in the base search
It might seem logical to reference a field only in the post-process searches, but it is better to isolate the data for the field in
the base search. Otherwise, the field that is referenced only in the post-process search becomes null in all rows, thus
returning zero results.
Passing a large number of search results to a post-process search can cause problems.
If the post-processing operation takes too long, it can result in performance problems and possibly a timeout. In this
scenario, consider the following:
• The number of results and fields returned from the base search.
• The complexity of the post-process operations on these results.
Incomplete data
If the base search is a non-transforming search that returns in excess of the event limitation, an incomplete data set is
passed to downstream panels (as described above). To avoid event limitation, use transforming commands in the base
search to structure results.
89
Post-process examples
Post-process works best when you reformat results from a base search that uses transforming commands.
This lets you create tables and charts according to specific criteria. For example, you can create different visualizations
and reports from the same data set. You can also do further aggregation on the original report.
This example uses transforming commands for the base search, post-processing the results differently:
Base search
index=_internal source=*splunkd.log | stats count by component, log_level
<dashboard>
<label>Dashboard with post-process search</label>
<row>
<panel>
<chart>
<title>Event count by log level</title>
90
</chart>
</panel>
<panel>
<chart>
<title>Error count by component</title>
<option name="charting.chart">bar</option>
</chart>
</panel>
</row>
</dashboard>
Chained post-process example
Chain two or more post-process searches together. The following example shows how to link one post-process search to
another one.
<search id="baseSearch">
<query>index=_internal</query>
<earliest>-60m@m</earliest>
<latest>now</latest>
</search>
For more complex base searches that include statistical aggregations such as percentiles, standard deviations, and even
averages, it is better to use summary indexing commands in the base search. This facilitates building the post-process
searches. Some examples of summary indexing search commands include:
◊ sistats
◊ sitimechart
◊ sitop
◊ sichart
◊ sirare
The summary index equivalents provide more flexibility for post-process searches. See Use summary indexing for
increased reporting efficiency and About transforming commands and searches.
Base search
index=_internal | eval event_size=len(_raw)
| sistats count min(event_size) avg(event_size) max(event_size)
by source sourcetype
91
Post process 1
| stats count
Post process 2
| stats avg(event_size) by sourcetype
Post process 3
| stats count by sourcetype
The base search reports event size (min, avg, max) by source and sourcetype for the _internal index. Use the sistats
count with the various group-by clauses. You lose the benefits of map-reduce in distributed search if you do not include
these.
<dashboard>
<label>Dashboard with post process using summary indexing</label>
<row>
<panel>
<single>
<title>Total event count</title>
92
<!-- post-process search -->
<search base="baseSearch">
<query>stats avg(event_size) by sourcetype</query>
</search>
<option name="charting.axisY.scale">log</option>
</chart>
</panel>
<panel>
<chart>
<title>Event count by source type</title>
<option name="charting.axisY.scale">log</option>
</chart>
</panel>
</row>
</dashboard>
Form with post-process search for inputs
You can use a post-process search to dynamically populate inputs to a form. The following example shows a form with
two inputs. The drop-down list, which selects an index to search, defines the choices statically. The drop-down list to
select a source type statically defines the default choice but uses a post-process search to dynamically define the other
choices.
93
Base search for populating the source type dropdown
index=_internal | stats count by sourcetype
<form>
<label>Post Process in Form Inputs</label>
<fieldset submitButton="false">
</input>
<input type="time" token="time_tok" searchWhenChanged="true">
<label></label>
<default>
<earliest>-24h@h</earliest>
<latest>now</latest>
</default>
</input>
</fieldset>
<row>
<panel>
<chart>
<title>Chart</title>
<search>
<query>
index=$index_tok$ sourcetype=$sourcetype_tok$ | timechart count
</query>
94
<earliest>$time_tok.earliest$</earliest>
<latest>$time_tok.latest$</latest>
</search>
</chart>
</panel>
</row>
</form>
In a search head clustering (SHC) deployment, if you are referencing a real-time saved search in a dashboard on a
search head, the real-time search might not continue to stream data after initial results are returned.
<search>
This type of search runs only when users view the
Use an inline real-time search <query>index=_internal | stats count
dashboard. However, a new real-time search
in the dashboard panel </query>
spawns for each user that accesses the dashboard
instead. <earliest>rt-5m</earliest>
from the search head or another member.
<latest>rtnow</latest>
</search>
If you are new to the Splunk platform and the search processing language (SPL), start with the Search Tutorial. This
tutorial introduces you to the Search and Reporting application. The tutorial guides you through adding data to your
Splunk deployment, searching your data, and building simple reports and dashboards.
The Search Manual includes detailed information about creating and optimizing searches, retrieving events, specifying
time ranges, and using subsearches.
The Search Reference is a reference guide for the Search Processing Language (SPL). The Search Reference contains a
catalog of the search commands with syntax, descriptions, and examples.
Dashboards and forms have one or more rows of panels. Each panel contains a visualization, such as chart, table, or
map. In each panel, a search generates data for the visualization.
Forms are different from dashboards because they include <input> elements, such as text boxes or radio buttons, for
user interactions. You can configure elements in a form, such as a panel, to respond to user input by customizing the
95
searches that drive visualizations or changing other behavior.
For more details on building a <dashboard> or <form>, see the Simple XML Reference.
See the Simple XML Reference for complete information on dashboard and form element hierarchy.
Element Description
top-level element <dashboard> or <form>
Global search is for use with post-process searches. Post-process searches have limitations. See Post-process
limitations.
Global search
<search id="[identifier]">
<fieldset>
<input>
<text>
<panel>
A visualization displays data returned from a search.
Visualizations
<chart> <event> <map> <single> <table>
A search for a visualization.
<search ref="[report] [ app="[app name]" ]> Reference a search from a report. Reference to app is
optional.
Options Properties specific to a visualization.
96
Element Description
<option name="[option name]">
Dashboard examples
This topic shows the source simple XML code behind dashboards. After you become familiar with the simple XML source
code, you can further customize the dashboard.
Basic dashboard
This example uses a few simple XML elements to create a basic dashboard.
<dashboard>
<!-- A title for the dashboard -->
<label>Basic Dashboard</label>
<table>
<title>Top Sourcetypes (Last 24 hours)</title>
<!-- Use options to further define how to display result data -->
<option name="wrap">true</option>
<option name="rowNumbers">true</option>
97
</table>
</panel>
</row>
</dashboard>
Searches power panels
• Inline search
• Search saved as a report
• Search from a prebuilt panel
• Inline search derived from a pivot
98
<dashboard>
<label>Searches power dashboards</label>
<description>Show the various searches to power a panel.</description>
<!-- This row contains three panels -->
<row>
<panel>
<table>
<title>(Inline Search) Top Source Types</title>
<!-- Inline Search -->
<search>
<query>
index=_internal | top limit=100 sourcetype
| eval percent = round(percent,2)
</query>
<earliest>-24h@h</earliest>
<latest>now</latest>
</search>
<option name="rowNumbers">true</option>
</table>
</panel>
<panel>
<chart>
<title>(Report) Top Source Types</title>
<!-- Reference to a search saved as a report -->
<search ref="Top Source Types Report" />
</chart>
</panel>
</row>
<row>
<panel ref="top_source_types_in_the_last_hour" app="search" />
<panel>
<chart>
<title>(Pivot) Game Purchases</title>
You can display search results in a table or event listing, but also specify various charts. Use the <chart> element,
specifying the chart type with the <option> child element.
99
<dashboard>
<label>Use charts to visualize results</label>
<description>Show a selection of visualizations from the same search</description>
<row>
<panel>
<!-- Display results as a table. Uses an -->
<!-- inline search, equivalent to the <searchName> -->
<!-- specified for the other panels -->
<table>
<title>Top Source Types (Table)</title>
<search>
<query>
index=_internal | top limit=10 sourcetype
</query>
<earliest>-24h</earliest>
<latest>now</latest>
</search>
</table>
</panel>
<panel>
<!-- display same search as various charts -->
<chart>
<title>Top Source Types (Bar)</title>
<search>
<query>
index=_internal | top limit=10 sourcetype
</query>
<earliest>-24h</earliest>
<latest>now</latest>
</search>
<!-- specify the chart type with this <option> to <chart> -->
<option name="charting.chart">bar</option>
<option name="charting.axisY.scale">log</option>
</chart>
</panel>
<panel>
100
<chart>
<title>Top Source Types (Column)</title>
<search>
<query>
index=_internal | top limit=10 sourcetype
</query>
<earliest>-24h</earliest>
<latest>now</latest>
</search>
<option name="charting.chart">column</option>
<option name="charting.axisY.scale">log</option>
</chart>
</panel>
</row>
<row>
<panel>
<chart>
<title>Top Source Types (Pie)</title>
<search>
<query>
index=_internal | top limit=10 sourcetype
</query>
<earliest>-24h</earliest>
<latest>now</latest>
</search>
<option name="charting.chart">pie</option>
</chart>
</panel>
<panel>
<chart>
<title>Top Source Types (Line)</title>
<search>
<query>
index=_internal | top limit=10 sourcetype
</query>
<earliest>-24h</earliest>
<latest>now</latest>
</search>
<option name="charting.chart">line</option>
<option name="charting.axisY.scale">log</option>
</chart>
</panel>
<panel>
<chart>
<title>Top Source Types (Area)</title>
<search>
<query>
index=_internal | top limit=10 sourcetype
</query>
<earliest>-24h</earliest>
<latest>now</latest>
</search>
<option name="charting.chart">area</option>
<option name="charting.axisY.scale">log</option>
</chart>
</panel>
</row>
</dashboard>
101
Dashboard with real time search
You can build a real-time dashboard using the Splunk Dashboard Editor or coding the dashboard using simple XML. This
example shows how to code the simple XML.
To enable real-time searching, use the <earliest> and <latest> child elements to the <search> element. For example, if
you want to enable real-time searching and display the data in a table, specify the following:
<table>
<title>Look here for errors</title>
<search>
<query>
error OR failed OR severe
OR ( sourcetype=access_* ( 404 OR 500 OR 503 ) )
</query>
'''<earliest>rt</earliest>'''
'''<latest>rt</latest>'''
</search>
<fields>host, source, errorNumber</fields>
</table>
You can also set a window for the real-time dashboard. For example, if you want to show real-time events but only from
the last 5 minutes.
<table>
<title>Look here for errors during the last 5 minutes</title>
<search>
<query>
error OR failed OR severe OR ( sourcetype=access_* ( 404 OR 500 OR 503 ) )
</query>
'''<earliest>rt-5m</earliest>'''
'''<latest>rt</latest>'''
</search>
<fields>host, source, errorNumber</fields>
</table>
For more information on setting a search window, see Specify real-time time range windows in your search in the Search
Manual.
Use the charting.fieldColors Simple XML property to customize field colors in a chart. The colors you select are the
same each time the chart displays, regardless of other charts or color specifications in the dashboard.
For more details about this property, see charting.fieldColors in the Chart Configuration Reference.
Example
The following example shows how to specify colors for a chart showing error counts per sourcetype. The example uses
this search.
Without charting.fieldColors, the visualization uses default field color mapping based on the order of values returned.
Here, ERROR appears blue.
102
To change the field color mapping, add the charting.fieldColors property to the dashboard's Simple XML source code.
For example, the charting.fieldColors configuration below defines these colors for each log level.
• INFO: green
• WARN: orange
• ERROR: red
<option name="charting.fieldColors">
{"ERROR": 0xFF0000, "WARN": 0xFF9900, "INFO":0x009900, "NULL":0xC4C4C0}
</option>
103
The following code implements a similar chart with custom field colors.
<panel>
<html>
Use <tt>eval</tt> function in the search to transpose
the value of the log_level field into individual fields
for <tt>charting.fieldcolors</tt>.
</html>
<chart>
<title>Field colors example</title>
<search>
<query>
index = _internal log_level=* | stats
count(eval(log_level="ERROR")) as ERROR
count(eval(log_level="WARN")) as WARN
count(eval(log_level="INFO")) as INFO
by sourcetype
</query>
<earliest>-7d@h</earliest>
<latest>now</latest>
</search>
<option name="charting.axisY.scale">log</option>
<option name="charting.chart">column</option>
<option name="charting.fieldColors">
{"ERROR": 0xFF0000, "WARN": 0xFF9900, "INFO":0x009900, "NULL":0xC4C4C0}
</option>
<option name="charting.legend.placement">right</option>
</chart>
</panel>
Specify properties for visualizations
Simple XML provides a set of simple XML elements that define properties that can be applied to all visualizations. For
properties specific to certain types of visualizations, such as <chart> or <map>, use the <option> element to specify a
property.
The use of a specific element or the <option> element varies. Consult the Simple XML Reference and Chart Configuration
Reference for details on specifying panel properties.
The following table summarizes some of the elements available for all visualizations.
Tag Description
String
<title>
Add a title to your panel, such as Failed logins. The title displays at the top of the
panel.
Splunk time format
<earliest>
<latest> Restrict search results to a specific time window, starting with the earliest time and
ending with the latest time. Specify "rt" to enable real-time searches.
The following example of a panel with a <chart> element shows how to specify a title and an inline search. It restricts
search results to a 5 hour window and to three fields:
104
<dashboard>
<label>My dashboard</label>
<row>
<panel>
<table>
<title>Top users, five hours ago</title>
<search>
<query>
host=production | top users
</query>
<earliest>-10h</earliest>
<latest>-5h</latest>
</search>
<fields>host,ip,username</fields>
</table>
</panel>
</row>
</dashboard>
The following example specifies various properties with the <option> element for a <table>.
<dashboard>
<label>My dashboard</label>
<row>
<panel>
<table>
<title>Errors in the last 24 hours</title>
<search>
<query>
Errors in the last 24 hours
</query>
</search>
<option name="count">15</option>
<option name="displayRowNumbers">true</option>
<option name="maxLines">10</option>
<option name="segmentation">outer</option>
<option name="softWrap">true</option>
</table>
</panel>
</row>
</dashboard>
The following example specifies a column chart visualization, with display names for the X and Y axes.
<dashboard>
<label>My dashboard</label>
<row>
<panel>
<chart>
<search>
<query>
sourcetype=access_* method=GET | timechart count by categoryId
| fields _time BOUQUETS FLOWERS
</query>
105
<earliest>-7d</earliest>
<latest>now</latest>
</search>
<title>Views by product category, past week (Stacked)</title>
<option name="charting.axisTitleX.text">Views</option>
<option name="charting.axisTitleY.text">Date</option>
<option name="charting.chart">column</option>
</chart>
</panel>
</row>
</dashboard>
Use the HTML panel to display static text
The HTML panel displays inline HTML. Use the HTML panel to add documentation, links, images, and other Web content
to a dashboard.
Content between the HTML tags is displayed according to the specified HTML formatting. Relative link references are
relative to the current view location. The HTML panel does not use any of the other general panel options and there are
no specific options to set for HTML.
For details on using HTML panels, refer to the <html> element entry in the Simple XML Reference.
In the example, the anchor tag accesses system reports using the special Splunk locator: @go?s=
. . .
<row>
<panel>
<html>
<p>This is an <i><b>HTML panel</b></i> providing links to system reports.</p>
<ul>
<li>
<p><a href="@go?s=Errors in the last hour">Errors in the last hour</a></p>
</li>
<li>
<p><a href="@go?s=Indexing workload">Indexing workload</a></p>
</li>
<li>
<p><a href="@go?s=License Usage Data Cube">License Usage</a></p>
</li>
106
</ul>
</html>
</panel>
. . .
</row>
Configure a dashboard with dynamic drilldown
Dynamic drilldown allows you to specify another Splunk view or a web page to link to from a field in the search results. To
implement dynamic drilldown in a dashboard, do the following:
• Within each <link> tag, specify either a Splunk view or web site to link to.
• Specify the value of the results to use for the drilldown action. For example:
♦ Specify a field name that can be used as a sourcetype for a Splunk view.
♦ Specify a value that can be passed to a website.
Form examples
A form is similar to a dashboard, but provides an interface for users to supply values to one or more search terms,
typically using text boxes, dropdown menus, or radio buttons. A form shields users from the details of the underlying
search – it allows users to focus only on the terms for which they are searching and the results. The results can be
displayed in tables, event listings, or any of the visualizations available to dashboards.
This topic contains basic examples that show how to create forms. Refer to the Splunk Dashboard Examples app for
additional examples that use more robust source data. The examples show how to use tokens to pass values in forms.
See Token usage in dashboards for details on token implementation.
The user input to a form defines tokens for the selected values of the input. A search in the form uses the tokens to
specify the values to use in the search. The search accesses the value for the token using the '$...$' as a delimiter for the
token value.
For example, the following code snippet defines a dropdown that uses the sourcetype_tok token to represent the
selection by the user. It also defines the choices for the dropdown.
107
<search>
<query>
index = _internal sourcetype=$sourcetype_tok$
| timechart count by sourcetype
</query>
<earliest>-7d</earliest>
<latest>-0d</latest>
</search>
<form>
<label>Form example: source type time chart</label>
<row>
<panel>
<chart>
<search>
<query>
index = _internal sourcetype=$sourcetype_tok$
| timechart count by sourcetype
</query>
<earliest>-7d</earliest>
<latest>-0d</latest>
</search>
</chart>
</panel>
</row>
</form>
108
Form with time inputs example
You can add one or more time inputs to a form. If you add a single time input, a token for the time input is not necessary.
The time input drives the data for all searches in the form.
However if you add additional time inputs to a form, specify a token for each time input. The searches in the form
reference the tokens to indicate which time input to use.
The following code snippet creates a time input that defines a token for local use.
<search>
<query>
index=_internal sourcetype=$sourcetype_tok$
| stats count as sourcetype</query>
<earliest>$time_tok.earliest$</earliest>
<latest>$time_tok.latest$</latest>
</search>
The following example uses a global timer that drives the Source Type Timechart panel. The Source Type Event Counter
panel contains a local time for that panel only.
109
<form>
<label>Form example: add time pickers</label>
<fieldset autoRun="true" submitButton="false">
<input type="dropdown" token="sourcetype_tok">
<label>Select a source type</label>
<default>splunkd</default>
<choice value="splunkd">splunkd</choice>
<choice value="splunk_web_access">splunk_web_access</choice>
<choice value="splunkd_ui_access">splunkd_ui_access</choice>
</input>
</fieldset>
<row>
<panel>
<title>Source type time chart</title>
<chart>
<search>
<query>index = _internal sourcetype=$sourcetype_tok$
| timechart count by sourcetype</query>
</search>
</chart>
</panel>
<panel>
<title>Source type event counter</title>
<single>
<search>
<query>
index=_internal sourcetype=$sourcetype_tok$
| stats count as sourcetype</query>
<!-- Use the earliest and latest modifiers to the time input token -->
<earliest>$time_tok.earliest$</earliest>
<latest>$time_tok.latest$</latest>
</search>
</single>
</panel>
</row>
</form>
110
Static and dynamic inputs to forms
The following form inputs require multiple choices for selection by the user. You can statically define the inputs or use a
search to dynamically populate the inputs to a form.
• Check box
• Dropdown
• Multiselect
• Radio
The search in the following example compares static and dynamic definition for choices. The dropdown uses a populating
search to define the choices.
• Populating <search>
Returns fields to use for the label and value of the choices.
• <fieldForLabel> <fieldForValue>
Child elements to the <input> element. These specify the fields to use to populate choices for the dropdown.
111
<form>
<label>Populate an input with a search</label>
<description>Events Filtered by User and Sourcetype</description>
<!-- Do not need a Search Button. Inputs search when changed -->
</fieldset>
<row>
<panel>
<!-- Use tokens from the <input> elements in the panel title -->
<title>
Input selections: (radio) "$username_tok$", (dropdown) $sourcetype_tok$
</title>
<chart>
112
</chart>
</panel>
</row>
</form>
Create a form with a global search
You can create a form that uses a global search that drives the data in the various panels. This scenario is another form
of post-process search. You should be careful about using post-process searches because of various limitations. In many
cases, a post-process search is not always the most efficient way to use search resources. Read carefully the topic
Post-process searches. It discusses Post-process best practices and other factors to consider before implementing a
post-process search.
The global search uses a transforming search command to avoid the 10,000 event limit for the number of events that you
can pass to a post-process search:
<search id="global_search">
<query>
index=_internal source=*splunkd.log | stats count by component, log_level
</query>
</search>
The values for the dropdown choices contain the post-process searches:
<search base="global_search">
<query>
$stats_tok$
</query>
113
</search>
Here is the complete code for a form with a global search:
<form>
<input type="time">
<default>Last 7 days</default>
</input>
</fieldset>
<row>
<panel>
<chart>
<option name="charting.chart">bar</option>
<search base="global_search">
<query>
$stats_tok$
</query>
</search>
</chart>
</panel>
</row>
</form>
Using a third party XML editor
In most cases, you use the Splunk Web dashboard editor to edit Simple XML. See About the dashboard editor to learn
more.
If you are using Splunk Enterprise, you can also use a third-party editor to work with dashboard source code files in your
deployment.
Splunk Cloud Platform users cannot use a third-party editor because access to dashboard source code files is not
available. If you have Splunk Cloud Platform, use the dashboard editor in Splunk Web.
Dashboard and form source code files can include the following.
• Simple XML
• JavaScript
• CSS
114
• Static HTML and image files imported by reference
When you edit Simple XML in the dashboard editor, source code file changes are written to the /local directory. Put
dashboard source code files that you edit with a third-party editor in the /local directory.
Caution: Do not put Simple XML source files in the /defaultdirectory. Files in the /default directory are overwritten on
deployment and app updates.
For more information on directories and file precedence, see Configuration file precedence.
Source code file location depends on the file type and permissions.
Put Simple XML and panel source code files in the following locations for each permission type.
Shared in app
$SPLUNK_HOME/etc/apps/<app>/local/data/ui/views/<file_name>
Private
$SPLUNK_HOME/etc/users/<user>/<app>/local/data/ui/views/<file_name>
HTML files
The /html directory in an app contains source files for dashboards converted to HTML.
115
Put HTML files in the following locations for each permission type.
Shared in app
$SPLUNK_HOME/etc/apps/<app>/local/data/ui/html/<dashboard_file_name>
Private
$SPLUNK_HOME/etc/users/<user>/<app>/local/data/ui/html/<dashboard_file_name>
To display changes to dashboard source code files, refresh configurations on your Splunk deployment by using the
debug/refresh endpoint.
http://localhost:8000/debug/refresh
A dashboard can import CSS and JavaScript files as well as image files and static HTML files. These files are in the
following location. The files cannot be in a subdirectory.
$SPLUNK_HOME/etc/apps/<app_name>/appserver/static/
• dashboard.css
• dashhboard.js
You can edit default files at this location or add additional CSS and JavaScript files. You can also add any HTML files that
you want to reference from a dashboard.
Use the script and stylesheet attributes in <dashboard> or <form> element to import a JavaScript or CSS file from the
default location for an app. You can also reference script and CSS files from other apps.
Examples
116
. . .
</dashboard>
117
Drilldown and Dashboard Interactivity
Drilldown behavior
Use drilldown to provide additional data insights to dashboard users. Drilldown lets users click on visualization elements
like data points, columns, table rows, or a visualization legend to open a secondary search in a new browser window. The
secondary search is similar to the search driving the visualization but it generates results customized to the element that
users click.
You can enable or disable drilldown using the visualization Format menu. Table visualizations and events lists provide
additional configuration options in this menu.
Use Simple XML to make additional customizations. For example, you can create a dynamic drilldown linking users from a
dashboard to a form or to an external website. A contextual drilldown links users to content on the same page.
Dynamic drilldown
Implement dynamic drilldown in Simple XML using the <drilldown> element with other simple XML elements. See
Drilldown elements in the Simple XML Reference for details.
Element Description
<drilldown> Defines a drilldown. Parent element of the other dynamic drilldown elements.
Publishes global tokens that can be consumed by any other element or search within a dashboard. Use <set> and <unset>
<set>
when displaying drilldown results on the same dashboard.
<unset> Removes a token that was previously set. Use <set> and <unset> when displaying drilldown results on the same dashboard.
To learn about using <set> and <unset> for contextual drilldown, see Contextual drilldown elements.
Dynamic drilldown uses drilldown event tokens to customize the values that you capture from a visualization. The tokens
available depend on the visualization. See Token usage in dashboards and Define tokens for drilldown in this manual.
118
For example, for a map visualization, the tokens specify the field and value from a map marker as well as latitude and
longitude values. For a table visualization, the tokens specify the name and value returned from a clicked cell. The
following table lists the drilldown event tokens available for a table visualization. See Drilldown event tokens in the Simple
XML Reference for a complete list of tokens available for all visualizations.
Token Description
click.name Name of the leftmost field that is displayed in the table. This is always _time, if present.
row.<fieldname> All field values for the clicked table row, including those fields that are not displayed.
earliest/latest Time range of the clicked table row, or if not applicable, the time range of the search.
Drilldown event tokens differ from the tokens you define with the <set> element. Drilldown event tokens are pre-defined
for capturing values from a click in a visualization. Tokens that are defined with the <set> element specify values that the
target destination consumes.
The <link> element provides various options for specifying the destination for dynamic drilldown. For details, see <link>
element in the Simple XML Reference.
When used with the <condition> element, you can specify the name of the field or series from which to capture values for
drilldown.
This example shows how to pass a drilldown value from a dashboard to a form in a separate app. The dashboard
contains a table. A click anywhere in a row of the table captures the value for the source type from the first column in the
row. This value is passed as the input value to the form.
119
This is the form, which is in a separate app. The value passed from the dashboard becomes the input to the form. The
form shows the results when a user of the dashboard clicks anywhere in the row for splunk_web_service source type.
Form
Source code for the table in the dashboard that implements dynamic drilldown:
<dashboard>
<label>Dynamic Drilldown</label>
<row>
<panel>
<table>
120
<search>
<query>index="_internal" | chart count by sourcetype | sort sourcetype</query>
<earliest>-7d@h</earliest>
<latest>now</latest>
</search>
<drilldown>
<link target="_blank">
/app/MyApp/drilldown_dynamic_target_form?form.src_type_tok=$row.sourcetype$
</link>
</drilldown>
<option name="drilldown">row</option>
</table>
</panel>
</row>
</dashboard>
Source code for the form that accepts the passed in value:
<form>
<label>Dynamic Drilldown (Target Form)</label>
<description/>
<fieldset submitButton="false" autoRun="true">
<input type="text" token="src_type_tok" searchWhenChanged="true">
<label>Source type</label>
</input>
</fieldset>
<row>
<panel>
<chart>
<title>Source type details</title>
<search>
<query>
index=_internal | timechart span=1week count by $src_type_tok$
</query>
<earliest>-30d@d</earliest>
<latest>now</latest>
</search>
<option name="charting.chart">column</option>
</chart>
</panel>
</row>
</form>
Single value drilldown using hidden fields
From a single value visualization you can drill down on hidden fields. The following example is from an app that uses
single value visualizations to display selected government regulations. The example app uses a global search that returns
information about government agencies, regulations, and regulation IDs. It contains two single value visualizations that
use post process searches to obtain the values to display.
• Select an agency
The selected agency name is displayed as a single value visualization.
• Select a regulation
Users can choose a regulation available from the agency they selected. The regulation name is shown as a single
value visualization.
121
The second single value visualization consumes the fields regulation_docketTitle and docketId from its post process
search. However, a single value field can only display the first returned value, which is the regulation_docketTitle in this
example.
The visualization uses the <drilldown> element to drill down on the "hidden value field," docketId. It specifies the hidden
field in the $row.<field>$ drilldown event token. See Single event tokens for a list of all drilldown event tokens.
$row.docketId$
The following source code shows how to access the hidden value field for single value visualizations.
<form stylesheet="regulations_explorer.css">
<label>Regulations Explorer</label>
122
<!-- Displays regulation_docket title -->
<search base="baseSearch">
<query>
| fields regulation_docketTitle, docketId
</query>
<earliest>$earliest$</earliest>
<latest>$latest$</latest>
</search>
<drilldown>
<link>
<![CDATA[ http://www.regulations.gov/#!docketDetail;D=]]>$row.docketId$
</link>
</drilldown>
</single>
</panel>
</row>
</form>
Contextual drilldown elements
Contextual drilldown generates results to a visualization on the same dashboard. Compare to the dynamic drilldown
example above, which generates drilldown results from one dashboard to a separate form. Use the <condition> element
with the <drilldown>, <set>, and <unset> elements to implement contextual drilldown.
Use the <condition> element as a child of the <drilldown> element. The field attribute of the <condition> element
specifies the fields whose values you want to capture. The <condition> element lets you specify different actions for the
drilldown, depending on the field clicked.
Use the <set> token to assign the value from a drilldown token to another token that the target of the drilldown consumes.
The <set> element is a child of the <condition> element. The <unset> element removes a token that was previously set.
Use the depends and rejects attributes of panel visualization elements to specify tokens that need to be present to
display a visualization.
This example shows how a click anywhere in a row of a table passes a value to a chart on the same page. The drilldown
captures the value from the first column in the clicked row to pass to the chart. The chart is hidden until a user clicks on
the table.
123
This example uses the <set> element to set the src_type_tok to the value returned from the $click.value$ drilldown
token, which is the value from the first column in the table. See table event tokens.
The chart consumes the src_type_tok in the depends attribute to the <chart> element, the <title> element, and in the
search. The depends attribute prevents the chart from displaying until a user clicks in the table.
<dashboard>
<label>Contextual drilldown</label>
<row>
<panel>
<table>
<title>Set sourcetype token on click</title>
<search>
<query>
index=_internal | stats count by sourcetype
</query>
<earliest>-4h</earliest>
<latest>now</latest>
</search>
<drilldown>
<set token="src_type_tok">$click.value$</set>
</drilldown>
</table>
</panel>
<panel>
<chart depends="$src_type_tok$">
<title>Chart for $src_type_tok$</title>
<search>
<query>
index=_internal sourcetype=$src_type_tok$
| timechart count by sourcetype
</query>
<earliest>-4h</earliest>
<latest>now</latest>
</search>
</chart>
</panel>
</row>
</dashboard>
Contextual example from map visualization
This example show how to drill down to markers on a map visualization. The map visualization shows earthquake activity
for the past month. The generated search on a map marker displays in a bar chart with details from the map data. For
example, a click on the marker straddling Montana, Utah, and Wyoming generates the chart on the right.
124
Note: This example uses earthquake data downloaded from the USGS Earthquakes website.
The following search shows earthquake activity for incidents greater than magnitude .9.:
The <drilldown> element sets tokens based on the bounds of a marker showing clustered locations. The captured values
derive from the click.bounds.<orientation> map token. See map event tokens for details on all map tokens available for
drilldown.
<drilldown>
<set token="bounds.north" > $click.bounds.north$</set>
<set token="bounds.east" > $click.bounds.east$</set>
<set token="bounds.south" > $click.bounds.south$</set>
<set token="bounds.west" > $click.bounds.west$</set>
</drilldown>
The chart contains the following search, which consumes the tokens that the drilldown action generates:
index=main mag > .9 | search latitude >= $bounds.south$ latitude < $bounds.north$ longitude >= $bounds.west$
longitude < $bounds.east$ | top place
Here is the source code that implements this contextual drilldown example:
<row>
<panel>
<map>
<search>
<query>
index=main mag>.9
| geostats latfield=latitude longfield=longitude count
</query>
<earliest>0</earliest>
<latest />
</search>
<option name="mapping.data.maxClusters">1000</option>
<option name="mapping.drilldown">all</option>
<option name="mapping.map.center">(39.3,-95.98)</option>
<option name="mapping.map.zoom">4</option>
<option name="mapping.markerLayer.markerMaxSize">40</option>
<option name="mapping.markerLayer.markerMinSize">20</option>
<option name="mapping.markerLayer.markerOpacity">0.9</option>
<option name="mapping.tileLayer.maxZoom">7</option>
<option name="mapping.tileLayer.minZoom">0</option>
<drilldown>
<set token="bounds.north">$click.bounds.north$</set>
<set token="bounds.east">$click.bounds.east$</set>
<set token="bounds.south">$click.bounds.south$</set>
<set token="bounds.west">$click.bounds.west$</set>
</drilldown>
<option name="mapping.tileLayer.url">
http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png
</option>
</map>
</panel>
<panel>
<chart>
<title>Places</title>
125
<search>
<query>
index=main mag>.9 | search
latitude >= $bounds.south$
latitude < $bounds.north$
longitude >= $bounds.west$
longitude < $bounds.east$
| top place
</query>
<earliest>0</earliest>
<latest />
</search>
<option name="charting.chart">bar</option>
</chart>
</panel>
</row>
Contextual example with multiple conditions
This example sets multiple conditions for drilldown. It contains a table listing event counts for source types by log level. A
click in the table generates a detail chart. The detail chart is not visible until the user drills down from the table. The
content of the detail chart differs, depending on where a user clicks in the table.
126
This example sets three conditions using the field attribute of the <condition> tag. Each condition sets token values for
$s_sourcetype$ and $s_log_level$. The search in the detail chart consumes these tokens.
<drilldown>
<condition field="sourcetype">
<set token="s_sourcetype">$row.sourcetype$</set>
<set token="s_log_level">*</set>
</condition>
<condition field="Total">
<set token="s_sourcetype">$row.sourcetype$</set>
<set token="s_log_level">*</set>
</condition>
<condition field="*">
<set token="s_sourcetype">$row.sourcetype$</set>
<set token="s_log_level">$click.name2$</set>
</condition>
</drilldown>
For all columns in the table, the token $s_sourcetype$ captures the value from the $row.sourcetype$ table token. This
sets the value to the source type of the clicked cell.
For the sourcetype and Total columns, a click sets the $s_log_level$ token value to '*'.
For the log level columns, a click sets the $s_log_level$ token value to the value of the $click.name2$ table token. This
token captures the name of the column of the clicked table cell.
The <chart> element for the detail chart sets the value of the depends attribute to $s_sourcetype$. The chart does not
display until drilldown from the table sets this token.
<chart depends="$s_sourcetype$">
Here is the source code implementing this dynamic drilldown example:
<dashboard>
<label>Contextual Example with Multiple Conditons</label>
<row>
<panel>
<table>
<title>Events: Source type by log level</title>
<search>
<query>
index=_internal log_level=*
| chart count over sourcetype by log_level | addtotals
</query>
<earliest>-7d@h</earliest>
<latest>now</latest>
</search>
<option name="drilldown">cell</option>
<drilldown>
<condition field="sourcetype">
<set token="s_sourcetype">$row.sourcetype$</set>
<set token="s_log_level">*</set>
</condition>
<condition field="Total">
<set token="s_sourcetype">$row.sourcetype$</set>
<set token="s_log_level">*</set>
</condition>
<condition field="*">
<set token="s_sourcetype">$row.sourcetype$</set>
127
<set token="s_log_level">$click.name2$</set>
</condition>
</drilldown>
</table>
</panel>
<panel>
<chart depends="$s_sourcetype$">
<title>
Events: sourcetype="$s_sourcetype$" and log_level="$s_log_level$"
</title>
<search>
<query>
index=_internal sourcetype="$s_sourcetype$"
log_level="$s_log_level$" | timechart count
</query>
<earliest>-7d@h</earliest>
<latest>now</latest>
</search>
</chart>
</panel>
</row>
</dashboard>
Dynamic drilldown in dashboards and forms
Link to custom destinations and content when users click on elements in a dashboard or form. You can use dynamic
drilldown to capture information from a source dashboard or form and pass it to a target. The target can be another
dashboard or form, or a page within your Splunk deployment. You can also link to an external website.
The drilldown is configured to link to a form. To show customized content in the form, the drilldown also captures values
from the source dashboard and/or elements that users click. For example, when users click the splunk_web_service
sourcetype in the table, this form opens.
128
When the form opens, the splunk_web_service sourcetype populates the form input and causes the form to show
customized content for this sourcetype.
Inside the <drilldown> element, use a <link> element to indicate the drilldown target and to customize content in a target
dashboard or form.
<drilldown>
<link>...</link>
</drilldown>
The <link> element contains a path to the target and any token values that you are passing from the source to the target.
These examples show you the syntax for specifying the target path and passing values.
Target and
Syntax
behavior
Use a relative path that includes the dashboard or form id.
Link to a dashboard in
<link>
your Splunk deployment.
[relative path]/[dashboard or form id]
</link>
Pass the <earliest> Add &earliest=$earliest$&latest=$latest$ to the target path and token values. Use the <![CDATA[ ...
and <latest> time ]]> wrapper to make sure that the & symbol is interpreted correctly.
129
Target and
Syntax
behavior
range modifiers from the
source search to a
search in the target. <link>
<![CDATA[
[relative path]/[dashboard or form
id]?form.[target_token_name]=[$source_value$]&earliest=$earliest$&latest=$latest$
]]>
</link>
The syntax for specifying destinations varies, depending on the type of chart you are using and the destination you
choose. Refer to the entries for <drilldown> element and <link> element in the Simple XML Reference. See also Token
usage in dashboards to review available token filters.
Conditional linking
When configuring a drilldown, you can capture token values from a source dashboard or form. You can use these values
to configure the target dashboard or form and show users customized content.
You might want to configure conditional linking to different targets depending on the specific elements that users click in
the source dashboard or form. To do this, add a <condition> element to the <drilldown>. The <condition> element
contains the conditional <link> target and values to use.
A table field or chart series attribute in the <condition> indicates the field or series value to evaluate for conditional
linking.
Examples
A dashboard includes a table with columns A, B, and C. Here are some examples of conditional drilldown linking.
<drilldown>
<condition field="A">
<link> [relative_path]/[target_form_id]?form.[target_token]=$[value_from_source]$ </link>
</condition>
</drilldown>
<drilldown>
130
<condition field="B">
<link>[target_URL]?q=$[value_from_source]$</link>
</condition>
</drilldown>
By default, drilldown targets open in the same browser window as the source dashboard or form. You can add a
target="blank" attribute to the drilldown element to make the target open in a new browser window.
<dashboard>
<label>Dynamic drilldown example</label>
<row>
<panel>
<table>
<drilldown target="blank">
<!-- Access the input on the target form, which is in the same app -->
<!-- sourcetype.tok is the token for an input to the target form -->
<link>
form_for_drilldown?form.sourcetype_tok=$click.value$
</link>
</drilldown>
</table>
</panel>
</row>
</dashboard>
Dynamic drilldown examples
These examples show you how to build dynamic drilldown into dashboards and forms.
Target form
If you are linking to a target dashboard or form, make sure that it is configured to receive any token values that you are
setting in the drilldown.
This form is the target for all of the following drilldown examples. The relative path for the form is
/app/search/form_for_drilldown.
131
The form has a dropdown input that lets users select a sourcetype value. The input uses the sourcetype token to
represent the selected value. This token is used in a search that generates a chart showing results for this sourcetype.
<form>
<label>Destination form for drilldown</label>
<fieldset autorun="true" submitButton="false">
<input type="dropdown" token="sourcetype">
<label>Select a source type</label>
<default>splunkd</default>
<search>
<query>
index = _internal | stats count by sourcetype
</query>
</search>
<fieldForLabel>sourcetype</fieldForLabel>
<fieldForValue>sourcetype</fieldForValue>
</input>
</fieldset>
<row>
<panel>
<chart>
<search>
<query>index = _internal sourcetype=$sourcetype$
| timechart count by sourcetype</query>
<earliest>-7d</earliest>
<latest>-0d</latest>
</search>
</chart>
</panel>
</row>
</form>
Dashboard linking to a form
This example shows you how to set up a drilldown that links dashboard users to a form. When users click on a table row
in the dashboard, the form opens to show customized content.
<drilldown>
<link>
<![CDATA[
/app/search/form_for_drilldown?form.sourcetype=$row.sourcetype$&earliest=$earliest$&latest=$latest$
]]>
</link>
</drilldown>
In the <link> element, the following drilldown components configure linking and token setting when users click on a table
row in the dashboard.
132
Drilldown behavior that
Component this component Details
configures
row
To pass token values from the source dashboard to the target form, query string parameters
are included in the path after the ? symbol.
form.sourcetype=$row.sourcetype$
When a user clicks a table row in the dashboard, pass the sourcetype value
Tokens customize form from this row to the form. Set the form.sourcetype token in the form to the
Token names content based on the table row $row.sourcetype$ value from the table row that the user clicked.
and values that users click in the
dashboard.
earliest=$earliest$&latest=$latest$
Set the earliest and latest time range modifiers in the form to the
$earliest$ and $latest$ values from the source dashboard.
The <![CDATA[...]]> tag makes sure that the & character is interpreted
correctly.
Complete dashboard source code
<dashboard>
<label>Dashboard with dynamic drilldown to a form</label>
<row>
<table>
<search>
<query>
index="_internal" group="per_sourcetype_thruput" |
chart sum(kbps) over series
</query>
<earliest>-60m</earliest>
<latest>now</latest>
</search>
<title>Top sourcetypes (drilldown example)</title>
<option name="count">15</option>
<option name="displayRowNumbers">false</option>
<option name="showPager">true</option>
<drilldown>
<link>
<![CDATA[
/app/search/form_for
_drilldown?form.sourcetype=$row.sourcetype$&earliest=$earliest$&latest=$latest$
]]>
</link>
</drilldown>
</table>
</row>
</dashboard>
133
Form linking to an external website
Link users who click an element in a chart to relevant search results on the Splunk Answers community forum.
Drilldown
<link>
http://answers.splunk.com/search.html?q=$click.value$
</link>
This drilldown includes the following components in the <link> element.
?q=$click.value$
Capture the clicked value from
Token names the chart and pass it to the The $click.value$ predefined token captures the clicked value from the chart. This
and values website as a URL query string value passes to the Answers search URL, meaning that it is used as a search term on the
parameter. Answers site. When the user clicks a value and the Answers site loads, users see search
results for this value.
<form>
<label>Form Search</label>
<fieldset>
<!-- Use the html tag to specify text to display -->
<html>
<p>Enter a sourcetype in the field below. This view returns the most recent 1000 events for that
sourcetype.</p>
<p>In the Matching Events, click in the series column to open the value clicked in a new form</p>
</html>
<!-- The default input is a text box with no initial value -->
<input token="sourcetype" />
<row>
<panel>
<!-- output the results as a 50 row events table -->
<table>
<title>Matching events</title>
134
<query>
index="_internal" group="per_sourcetype_thruput" series=$sourcetype$
| chart sum(kbps) over series
</query>
</search>
<option name="count">50</option>
</form>
Dashboard linking to a multivalue field
You might have a dashboard that includes multivalue fields. Multivalue fields can appear multiple times in an event. Each
time this field type appears in an event, it can have a different value. You can configure a drilldown to link to specific
targets depending on the value that users click.
See Configure multivalue fields in the Knowledge Manager Manual for more information on working with multivalue fields
in your data.
Example
A dashboard includes a multivalue badges field representing user checkins to a conference event. This drilldown captures
a clicked value from the badges field.
<drilldown>
<condition field="badges">
<link>
/app/foursquare_vegas/vegas_badge_1?form.badge=$click.value2$
</link>
</condition>
</drilldown>
The drilldown includes the following components to set a target and capture the clicked value.
135
Drilldown behavior that this
Component Details
component configures
Open this form when users click a
Target form path badges value in the source /app/foursquare_vegas/vegas_badge_1/
dashboard.
?form.badge=$click.value2$
Show customized content in the
Token names and values
target form. Set the form.badge token in the target form to the multivalue field
$click.value2$ that the user clicks in the source dashboard.
Complete dashboard source code
<dashboard>
<label>Demo: drilldown</label>
<row>
<panel>
<table>
<searchString>
index=foursquare checkin.primarycategory.nodename=*
| spath output=venue path=checkin.venue.name
| spath output=badges path=checkin.badges{}.name
| eval link="Yelp Search"
| stats count as checkins sparkline values(badges)
as "badges" values(link) as "links" by venue
| sort -checkins
</searchString>
<drilldown>
<condition field="venue">
<link>
/app/foursquare_vegas/vegas_venue_1?form.venue=$row.venue$
</link>
</condition>
<condition field="links">
<link>
http://www.yelp.com/search?find_desc=$row.venue$&find_loc=Las+Vegas,+NV
</link>
</condition>
</drilldown>
136
</table>
</panel>
</row>
</dashboard>
Most of the searches access data available from the Search Tutorial. If you want to download the data from the Search
Tutorial to create the dashboards from these examples, see Get the tutorial data into your Splunk deployment.
Overview
Use predefined tokens or generate custom tokens to capture and access dynamic values. Tokens can propagate these
values throughout a dashboard or form.
As an example, a token can capture a value that users select in a form input. You can use this token value in one or more
search strings to generate visualizations that reflect this value. You might also use the value to manage which panels to
display.
• Define tokens to specify conditional actions, based on the value of the token.
• Define tokens within a search string that use values based on previously defined tokens.
Defined tokens include tokens for visualizations, for time inputs, and labels and values of form inputs.
There are many use cases for accessing the value of a token.
The inputs to a form modify the data a visualization displays. Tokens defined with user
Form inputs
inputs modify the search of the form.
For forms with multiple time pickers, tokens indicate the time picker to use for each
Multiple time pickers in forms
visualization.
When a user clicks a visualization in a dashboard, predefined tokens capture the value
Dynamic drilldown
clicked for the drilldown operation.
Conditional display of dashboard elements Tokens set and unset conditions for the display of panels and their contents.
137
Use Case Description
Tokens capture and pass values in a dashboard. Token values can come from various sources, including form inputs and
predefined token values for visualizations. Searches can access token values.
In a search, token name syntax uses $...$ delimiters. For example, if you define a form input token as field_tok, you
can specify the token in a search as $field_tok$. Here is an example.
<search>
index=_internal source=*splunkd.log | stats count by $field_tok$
</search>
See Token filters for advanced syntax to access token values.
If you are using SplunkJS Stack with JavaScript extensions, see Tokens and Data Binding on the Splunk Developer Portal
to learn how to use tokens with JavaScript.
You can set search tokens for a dashboard to display search job metadata or to control dashboard behavior.
There are many ways to use search tokens. Here are some example use cases.
There are also various advanced options for working with search tokens. Options include the following:
• Show the time range of the search below the visualization element using HTML.
• Build a custom HTML element and insert search results as tokens.
• Define token values based on the result of token-specific eval expressions.
There are several search event handlers that you can use in Simple XML dashboards.
Handler name Access to search job properties? Access to first results row?
<progress> Yes Yes
<cancelled> No No
138
Handler name Access to search job properties? Access to first results row?
<error> No No
<fail> No No
Within a search event handler, you can access specific job properties with tokens. For example, here are some commonly
used job metadata tokens.
• $job.messages$: List of error and/or debug messages generated by the search job.
For more details on event handler elements, available properties, and usage examples, see Search event handlers.
To learn about more search job properties, see View search job properties in the Search Manual.
Here is an example of the <search> element for a dashboard that hides a panel if no search results are returned.
<search id="search_logic">
<query>$index_switcher$ | top sourcetype</query>
<earliest>-60m@m</earliest>
<latest>now</latest>
<progress>
<!-- match attribute for condition uses eval-like expression (see Splunk search language 'eval'
command) -->
<!-- logic: if resultCount is 0, then show a static html element, and hide the chart element -->
<condition match="'job.resultCount' == 0">
<set token="show_html">true</set>
</condition>
<condition>
<unset token="show_html"/>
</condition>
</progress>
</search>
For more examples, see the Splunk Dashboard Examples App.
Add custom logic to a dashboard with the <condition match=" "> and <eval> elements.
For both <condition> and <eval> elements, all data available from an event as well as the submitted token model is
available as a variable within the eval expression.
139
Token syntax
As of software version 6.4, you can use either $...$ delimiters or single quote delimiters for tokens in an <eval> or
<condition match=" "> statement. For example, both of the following options are valid.
Use the <condition match=" "> element to define conditional behavior. The following example controls a token value
according to the result count job property.
You can also use a dashboard eval expression to define a condition to match. Here is an example using <condition
match=" "> to set a token value depending on whether the selected time range spans more than one day.
The following example sets up conditional token setting that depends on the sourcetype field value in the first results row.
If the sourcetype field value in the first results row is mongod, the "show_table" token is set to true.
To specify the "mongod" string in the conditional match statement, replace the quotation marks with the equivalent HTML
character entities.
<condition match="'result.sourcetype'=="mongod"">
    <set token="show_table">true</set>
</condition>
For more information about using special characters in dashboard source code, see Editing Simple XML.
You can use eval expression logic to define token filtering and formatting. For example, you can set a token value to the
result of an eval expression.
140
Dashboard <eval> expression functionality
The dashboard eval expression has the same syntax and semantics as the eval expression syntax for SPL queries. Most
of the same eval expression functionality is the same between the dashboard eval expression and the SPL version of
eval. However, there are some important exceptions.
• commands(X)
• searchmatch(X)
• exact(X)
• Cryptographic hash functions:
*md5(X)
*sha1(X)
*sha256(X)
*sha512(X)
*sigfig(X)
*spath(X,"Y")
It is also important to note that regular expressions in dashboard eval expressions use the syntax and semantics of the
JavaScript regular expression engine. This is not the same engine used for SPL eval expressions. If you are using regular
expressions in search tokens, check that syntax and semantics match those for JavaScript.
To learn more about eval expression functions, see eval in the Search Reference.
You can use an eval expression in <condition> event handler elements. Here is an example.
You can also compute a token's value based on the result of an eval expression. Here is an example.
All form inputs have a token attribute that defines a token for the user-selected value for the input. Form inputs also have
child <prefix> and <suffix> elements that further modify the value of the token. For multiselect options, there are additional
elements that can modify the value of the token. See Define tokens for multiselect inputs.
141
This code snippet defines a token for a drop-down list. The selected choice for the dropdown provides the value of the
token.
A multiselect input uses the <prefix>, <suffix>, <valuePrefix>, <valueSuffix>, and <delimiter> elements to build the
multiselection search for the selected choices. The multiselection search, which is the value of the token for the input,
ensures that the input passes all selected values to the search for the form.
The following code snippet shows how to build a value for the multiselect token. If a user selects both splunkd and
splunk_web_access from the multiselect input, the token value is the following search fragment:
<choice value="splunk_web_access">splunk_web_access</choice>
<choice value="splunkd">splunkd</choice>
<choice value="splunk_ui_access">splunk_ui_access</choice>
<choice value="splunkd_access">splunkd_access</choice>
</input>
See Multiselect input example.
If you have a form with panels that use different time pickers, use tokens for the time input to indicate the time picker to
use for each panel. To access the earliest and latest values from a time picker, use the following modifiers to the token:
• $timer_tok.earliest$
• $timer_tok.latest$
142
A time input that does not define a token is global. The values selected from such a time picker applies to all visualizations
that do not otherwise specify a time picker.
You can define tokens for conditional operations for form inputs. The value of the token changes according to the
condition you specify. For example, you can modify searches or select different visualizations to display based on the
conditional value of a token.
Conditional operations are available for form inputs and dynamic drilldown. Form inputs use various combinations of the
following elements:
Element Description
<change> Container element for the conditions that you define.
Sets the condition based on the value of the input selection. In the Conditional input example, this is the value of the selected
<condition>
choice for the drop-down list.
Defines various values for a token. The <search> element in the dashboard consumes the value of this token.
<set>
In the Conditional input example, defines value for the token earliest_tok.
Removes a token that was previously set.
<unset>
This is useful for conditional operations that depend on a token being set.
See the example at Conditional operations with form inputs.
Splunk Enterprise provides predefined tokens to access the label and value of form inputs. Tokens are available for the
following inputs:
• check box
• drop-down list
• multiselect
• radio buttons
Token Description
label Contains the specified name of a form input choice.
143
Token Description
value Contains the value of a form input choice.
These tokens are useful to customize a search or place the label of the selected choice in a title or description of a panel
or visualization.
Add an <init> element to a dashboard or form to reuse content or create a template. The token values inside this
element are set when the dashboard page loads.
Guidelines
Within a <dashboard> or <form> element, place content to set on page load inside the following tags.
<init>
</init>
• You can use the following event handlers to specify token settings within the <init> tags.
♦ <condition>
♦ <eval>
♦ <link>
♦ <set>
♦ <unset>
• PDF scheduling is disabled for dashboards and forms that include an <init> element.
• Token settings made within the <init> element override any settings made in URL query string parameters.
• Token setting on page load is only supported for Simple XML dashboards. If you convert a dashboard to HTML,
token settings within the <init> element are disabled.
Example
This form sets an app name token on page load. The token value is used in a panel label and a search with the |s$ filter
to wrap the value in quotation marks.
<form>
<label>Application Monitoring: Exchange</label>
<init>
<set token="app_name">my_app_name</set>
</init>
<row>
<panel>
<title>Activity Monitoring: $app_name$</title>
<search>
<query>index=main app=$app_name|s$</query>
</search>
144
</panel>
</row>
</form>
Access details about the user, Splunk platform instance, and environment using global tokens. The following tokens are
available.
Name Description
$env:user$ Current user's user name
$env:instance_type$ Indicates whether the current instance is Splunk Cloud or an on-premises deployment
$env:is_cloud$ Indicates if the current instance is Splunk Cloud. This token is only set when "true".
$env:is_enterprise$ Indicates if the current instance is a Splunk Enterprise deployment. This token is only set when "true".
$env:is_hunk$ Indicates if the current instance is a Hunk deployment. This token is only set when "true".
$env:is_lite$ Indicates if the current instance is a Splunk Light deployment. This token is only set when "true".
$env:is_lite_free$ Indicates if the current instance is using a Splunk Light free license. This token is only set when "true".
$env:is_free$ Indicates if the current instance is using a Splunk Enterprise free license. This token is only set when "true".
Splunk Enterprise provides predefined tokens for dynamic drilldown. The predefined tokens capture values according to
the location a user clicks in a visualization. See Dynamic drilldown in dashboards and forms.
The predefined tokens available and the values they capture, differ according to the type of visualization. The following
table lists the predefined tokens for the table visualization. Drilldown event tokens in the Simple XML Reference lists all
predefined tokens for dynamic drilldown.
Token Description
click.name Name of the leftmost field that appears in the table. This is always _time, if present.
145
Token Description
row.<fieldname> All field values for the table row, including those fields that are not displayed.
earliest/latest Time range of the table row, or if not applicable, the time range of the search.
The <link> element uses the value of the predefined token to link to a new view or web page. See Predefined tokens for
accessing labels and values of form inputs. Predefined tokens are also useful in conditional operations using the
<drilldown> element.
Conditional operations are available for both form inputs and conditional drilldown. Defining tokens for conditional
drilldown uses various combinations of the following tags:
Element Description
<drilldown> Define link destinations for fields in a dashboard or form. You can also use with <condition> to set tokens for custom actions.
Use with the <set> element to set the time window for the pan and zoom features of charts.
See Chart controls and the <selection> entry in the Simple XML Reference.
<link> Specify a link to a destination for drilldown.
Use the <set> element to define tokens for conditional use. You can use the value of another token when defining a token
with the <set> element. For example, the following code snippet defines the sourcetype_tok token. This token captures
the value clicked from a <table> element for the field sourcetype.
<drilldown>
<condition field="sourcetype">
<set token="sourcetype_tok">$click.value2$</set>
146
</condition>
</drilldown>
You can use the sourcetype_tok token in a search:
Use the <condition> element to select a value for multivalue fields in a visualization
Multivalue fields are fields that appear multiple times in an event and have a different value for each appearance. See
Configure multivalue fields in the Knowledge Manager manual.
If you have a dashboard that displays multivalue fields, use the <condition> element to specify a drilldown location specific
to the value of a clicked field. The following example links to different destinations based on the specific value for the field.
The <link> element consumes different predefined tokens for each condition. See Dashboard linking to a multivalue field
for the complete example.
<drilldown>
<condition field="badges">
<link >
/app/foursquare_vegas/vegas_badge_1?form.badge=$click.value2$
</link>
</condition>
<condition field="venue">
<link>
/app/foursquare_vegas/vegas_venue_1?form.venue=$row.venue$
</link>
</condition>
<condition field="links">
<link>
http://www.yelp.com/search?find_desc=$row.venue$&find_loc=Las+Vegas,+NV
</link>
</condition>
</drilldown>
Define tokens for pan and zoom chart controls
Splunk Enterprise uses predefined tokens to implement the zoom feature on a chart. Using the zoom feature, you can
select a portion of a data series in a chart that opens in a separate chart. See Pan and zoom chart controls.
Set the values of the predefined tokens within a <selection> element that is a child element of a chart. Use the token
values in the original chart to display a new chart that zooms to the selection.
Token Description
Captures the value of the x-axis at the beginning and end of a selection in a chart.
start
end Valid only in the context of the chart. Assign the values to tokens that you define to access the values
elsewhere in a dashboard.
Captures the values for the y-axis values for a selection. <field> represents a series displayed in the chart.
start.<field>
end.<field> Valid only in the context of the chart. Assign the values to tokens that you define to access the values
elsewhere in a dashboard.
See Pan and zoom chart controls for an example that shows how zoom to a selection in a time chart.
147
Syntax to consume tokens
Use $...$ delimiters to access the value of a token. For example, the following search for a visualization accesses the
field_tok token. A form input previously defined the field_tok token:
Token filters
Token filters ensure that you correctly capture the value of a token.
Filter Description
Wrap value in quotes Ensures that quotation marks surround the value referenced by the token. Escapes all quotation characters, ",
$token_name|s$ within the quoted value.
<search>
<query>
index=_internal sourcetype=$sourcetype_tok|s$ | timechart count by sourcetype
</query>
</search>
If the value of sourcetype_tok is access_combined, it builds the following search string:
If you include static text that contains the $ character, use $$ to escape the token delimiter value.
You can combine literal values with the value returned from a token. Use with the <set> element to set conditional actions
based on token values.
The following template combines the captured value from the predefined token, click.value, with static text. It places the
value of NewToken in quotation marks.
<set token="NewToken">sourcetype=$click.value|s$</set>
If the value of click.value is access_combined, then the value of NewToken is the following search fragment:
148
sourcetype="access_combined"
You can use the prefix and suffix attributes to the <set> element to specify static text for a token value. The following
example sets the value for NewToken. It is equivalent to the template example:
You can use token values to conditionally show or hide user interface components. The following elements contain the
attributes depends and rejects. Use the <set> and <unset> elements to set the token values that these attributes
consume.
• <row>
• <panel>
• <chart>
• <event>
• <html>
• <map>
• <single>
• <table>
• <input>
For example, show the <chart> element only when the showChart token has been set.
<chart depends="$showChart$">
Examples of token usage
This example shows the basic usage of tokens in form inputs. It uses a drop-down list to select the source type for the
time chart. See Define tokens for form inputs.
The <input> element defines the sourcetype_tok that is consumed by the search for the visualization.
149
<form>
<label>Form example: source type time chart</label>
<fieldset autorun="true" submitButton="false">
<input type="dropdown" token="sourcetype_tok">
<label>Select a source type</label>
<default>splunkd</default>
<choice value="splunkd">splunkd</choice>
<choice value="splunk_web_access">splunk_web_access</choice>
<choice value="splunkd_ui_access">splunkd_ui_access</choice>
</input>
</fieldset>
<row>
<panel>
<chart>
<search>
<query>
index = _internal sourcetype=$sourcetype_tok$
| timechart count by sourcetype
</query>
<earliest>-7d</earliest>
<latest>-0d</latest>
</search>
</chart>
</panel>
</row>
</form>
Multiselect input example
This example shows how to build a search string for a form input using static text and token values. This is useful for
building multiselect options. See Define tokens for multiselect inputs.
The example uses the <prefix>, <suffix>, <valuePrefix>, <valueSuffix>, and <delimiter> elements to build the multiselect
search string. When a user selects splunkd and splunk_web_access, it generates the following search string:
150
<form>
<label>Form with multiselect</label>
<fieldset autoRun="false" submitButton="true">
<html>
<p>
<strong>Multiselect choices</strong>
</p>
</html>
<input type="multiselect" token="sourcetype_tok" searchWhenChanged="false">
<label>Select one or more source types</label>
<choice value="*">All</choice>
<choice value="splunk_web_access">splunk_web_access</choice>
<choice value="splunkd">splunkd</choice>
<choice value="splunk_ui_access">splunk_ui_access</choice>
<choice value="splunkd_access">splunkd_access</choice>
</input>
</fieldset>
<row>
<panel>
<title></title>
<chart>
<search>
<query>index =_internal $sourcetype_tok$ | stats count by sourcetype</query>
<earliest>-24h</earliest>
<latest>now</latest>
</search>
<option name="charting.chart">line</option>
<option name="charting.axisY.scale">log</option>
</chart>
</panel>
</row>
</form>
Time input example
This example shows how to use both a global and local time picker in a form. It also shows how to access the predefined
modifiers to a time input token. See Define tokens for time inputs.
The example shows a form with both a global time picker and local time picker. The <chart> element contains the local
time picker and uses modifiers to the local_time_input_tok token to access the earliest and latest values.
151
<form>
<panel>
<title>Local timer</title>
<!-- Define token for local timer -->
<input type="time" searchWhenChanged="true" token="local_time_input_tok">
152
<label>Select time range</label>
<default>
<earliest>-24h@h</earliest>
<latest>now</latest>
</default>
</input>
<chart>
<search>
<query>
index=_internal $source_tok$ | timechart count
</query>
</form>
This example shows how to use conditional operations with form inputs. See Define tokens for conditional operations with
form inputs.
The example uses the <change>, <condition>, and <set> elements to conditionally set the label for the selected time and
to set the earliest time token. The search consumes the earliest time token to set the bounds for the search. This example
uses the label and value predefined tokens for input choices. See Predefined tokens for accessing labels and values of
form inputs.
153
Note: All input elements, with the exception of the time input, require a token attribute to be present. In the
example, the input element defines the token, period_tok. However, this token is never consumed by the search.
<form>
<label>Use tokens with conditional input choices</label>
<fieldset submitButton="false">
<input type="radio" token="period_tok">
<label>Select a time range</label>
<choice value="-24h@h">Last 24 Hours</choice>
<choice value="-7d@h">Last 7 Days</choice>
<choice value="-30d@h">Last 30 Days</choice>
<default>Last 24 Hours</default>
<search>
<query>index = _internal | timechart count by sourcetype</query>
<!-- use the value of earliest_tok -->
<!-- to set the time range -->
<earliest>$earliest_tok$</earliest>
<latest>now</latest>
</search>
<option name="charting.axisY.scale">log</option>
<option name="charting.axisTitleX.text">Time periods</option>
<option name="charting.axisTitleY.text">Events</option>
</chart>
</panel>
</row>
</form>
154
Access labels and values of form inputs
This example shows how to use tokens to access the labels and values of form inputs. See Predefined tokens for
accessing labels and values of form inputs.
The example uses the label of the selected radio button in the title of the visualization. It uses the value of the selected
radio button to determine the bounds of the search.
<form>
<label>Use tokens with input choices to capture input labels and values</label>
<fieldset submitButton="false">
<input type="radio" token="period_tok">
<label>Select a time range</label>
<choice value="-24h@h">Last 24 Hours</choice>
<choice value="-7d@d">Last 7 Days</choice>
<choice value="-30d@d">Last 30 Days</choice>
<default>Last 24 Hours</default>
<change>
<!-- use predefined input tokens to set -->
<!-- tokens for the selected label and value -->
<set token="date_label">$label$</set>
<set token="earliest_tok">$value$</set>
</change>
</input>
</fieldset>
<row>
<panel>
<title>Conditional Inputs</title>
<chart>
<!-- Display selected label in the title -->
<title>Source Type by $date_label$</title>
<search>
<query>index = _internal | timechart count by sourcetype</query>
<!-- use the value of earliest_tok -->
<!-- to set the time range -->
155
<earliest>$earliest_tok$</earliest>
<latest>now</latest>
</search>
<option name="charting.axisY.scale">log</option>
<option name="charting.axisTitleX.text">Time period</option>
<option name="charting.axisTitleY.text">Events</option>
</chart>
</panel>
</row>
</form>
Chart controls
This topic describes advanced behavior for viewing data in charts.
The pan and zoom feature allows you to highlight chart details and optionally view the details in a separate panel. Pan
and zoom is available for the following charts:
• Column
• Line
• Area
The following examples show how to access the pan and zoom charting features.
The following dashboard shows a chart displaying source types over a seven day period. The Y-axis uses a logarithmic
scale to provide a more meaningful graphic. The panel specifies the following search.
The screen capture below shows a selection for the results for two days.
156
The resulting chart zooms in to the selection and now displays details of the selected area.
• Use the left and right arrows along the X-axis to move the selection window earlier or later.
• Click Reset Zoom to return to the original chart.
You can specify pan and zoom behavior to display results in a separate chart. The following example uses the same base
example illustrated above in Pan and zoom behavior. The chart on the left lists all source types and also shows the
selection for a single day. The other chart lists only the splunk_web_access source type for the selected time range.
You can drag an edge of the time range in the left chart to expand the time range. You can also move the selected time
range to the left or right to specify an earlier or later time range.
The chart at the bottom shows the values for the tokens that implement the pan and zoom behavior.
157
Implementation details
To display zoom results in a separate chart, first edit the base chart in simple XML. Use the <selection> element to set
token values for the selection time range.
Note: See Token usage in dashboards for information on tokens. The section Define tokens for pan and zoom
chart controls provides details for tokens specific to pan and zoom behavior.
$start$
$end$
Predefined tokens that capture the values of the X-axis at the beginning and end of the selection time range. In this
example, capture the time at the beginning and end of a time chart. The value is in epoch time.
$start.splunk_web_access$
$end.splunk_web_access$
Captures the values of the Y-axis for the specified series at the beginning and end of the selection. In this example, the
value is the number of events for the field splunk_web_access.
The start and end tokens are valid only in the context of the chart. Assign the values to tokens that you define so you can
access the values throughout the dashboard.
<chart>
<title>Pan and Zoom (All source types)</title>
<search>
<query>
index=_internal | timechart count by sourcetype
</query>
<earliest>-7d@h</earliest>
<latest>now</latest>
</search>
. . .
<selection>
<set token="selection_earliest">$start$</set>
<set token="selection_latest">$end$</set>
<set token="start_splunk_web_access">$start.splunk_web_access$</set>
<set token="end_splunk_web_access">$end.splunk_web_access$</set>
</selection>
. . .
</chart>
In the target chart, use $selection_earliest$ and $selection_latest$ to access the selection time range.
<chart>
<title>Pan and Zoom (Web access source type)</title>
<search>
<query>
index=_internal sourcetype=splunk_web_access
| timechart count by sourcetype
</query>
<earliest>$selection_earliest$</earliest>
<latest>$selection_latest$</latest>
</search>
. . .
</chart>
The HTML panel shows the values captured by the $start$ and $selection$ tokens.
158
<html>
<h3>Token values for the splunk_web_access selection</h3>
<table border="0" cellpadding="12" cellspacing="0">
<tr>
<td>
<p><b>Time range (epoch time)</b></p>
<p><b>$$selection_earliest$$</b>: $selection_earliest$
<br /><b>$$selection_latest$$</b>: $selection_latest$</p>
</td>
<td>
<p><b>Count at the begining and end of time range.</b></p>
<p><b>$$start_splunk_web_access$$</b>: $start_splunk_web_access $
<br /><b>$$end_splunk_web_access$$</b>: $end_splunk_web_access$</p>
</td>
</tr>
</table>
</html>
Chart overlay
Use chart overlays to represent two different series on a single chart. You can highlight one series of search results as a
line graph on top of a column chart, area chart, or another line chart.
When using overlays, you can specify the overlaid values on a single axis or dual axis. With single axis, you plot the
overlaid value and the search results against the same Y-axis. For dual axis, you specify a second Y-axis to represent the
overlaid values.
This example shows the count of splunk_web_access source type events over a time chart on a weekly basis for one
month. Overlaid on this chart is the weekly average count of these events.
159
Here is the search to create this chart:
This example overlays the event count of the splunk_web_access source type against the total for all source types. The
chart plots the Web Access totals against a separate Y-axis.
160
4. Click in the Overlay field. Select Web Access from the fields available for selection as an overlay.
5. For View as Axis, click On to specify a second Y-axis.
6. For Title, click Custom. Type Web Access in the adjacent text field to specify a title for the second axis..
7. For Scale, click Inherit to inherit the selection for the scale from the first Y-axis.
161
Manage and Share Dashboards
A dashboard is a knowledge object. The roles that you hold as a Splunk platform user govern your ability to configure
dashboard permissions for yourself and others.
The following table shows the permissions management functions that the default roles in a new Splunk Platform
implementation grant.
Power, Admin
Share private dashboards with users of an app, or users of all apps.
Set read and write access to a dashboard, by role.
Your implementation might have a different set of roles for its users. Or it could have the default roles but the permission
management abilities might be moved around between them. If you want more information about the permission
management capabilities of your role, talk to your Splunk administrator. For more information about role-based knowledge
object permissions management, see Manage knowledge object permissions in the Knowledge Manager Manual.
The search that drives a dashboard panel is a separate knowledge object from the dashboard. The search has its own
configurable permissions. Inline, or ad hoc searches, rather than saved searches, are not knowledge objects, so you don't
need permission to view visualizations that ad hoc searches drive. To limit access to ad hoc searches, as an admin, you
must restrict access to one of the knowledge objects that the ad hoc search depends on, such as an index or a source.
A saved panel search can run using the permissions of the person who created the saved search (the search owner) or
the person who views the dashboard (the search user). The search user context can affect results and what different
users see in a dashboard panel. For example, if you have permissions to an index that others do not, you might want to
run the saved search as the owner so that any other user will see the same results.
Depending on the results data access that you want to provide, you can adjust the permissions context for the search in
the Reports listing page. Locate the search on this page and select Edit > Edit Permissions to change whether the
search runs with the owner or user context. For more details about the permissions for saved searches and reports, see
Set report permissions.
Also, consider the enabled permissions for other knowledge objects in a dashboard, such as Field Extractions and Event
Types. For additional information on setting up permissions for other knowledge objects see Manage knowledge object
permissions in the Knowledge Manager manual.
162
Specify permissions for a new dashboard
When you create a new dashboard from the Search or Dashboard pages, you can configure permissions. Choose one of
the following options.
Option Description
Private Only you have permission to view and edit the dashboard. The dashboard is not visible to other users.
The dashboard is available to other users in the app context where it was created. For example, if you create the dashboard in the
Shared in
Search and Reporting app, the dashboard is visible to other users in this context. Depending on their permissions, other users
app
can edit the dashboard.
There are some limitations to PDF generation. See "Limitations to PDF generation" for details.
For information on sending scheduled report PDFs as email attachments, see "Schedule reports", in the Reporting
Manual.
1. From the dashboard, select Export > Export PDF. The generated PDF appears in a browser window.
2. View, download, or print the PDF from the browser window.
163
1. From the dashboard, select Export > Print. The default print driver for your browser opens with print settings.
PDF generation has special time range handling for real-time searches. PDFs for real-time searches, reports, or
dashboards show results for the search time window relative to PDF generation time. As an example, when you generate
a PDF for a real-time search with a five minute time window, the PDF shows search results for the past five minutes.
PDFs for dashboard panels with "real-time all time" search time ranges show results for the search over all time.
Authorized users can schedule PDF delivery for dashboards. To set up PDF delivery, select Export > Schedule PDF
delivery. Ensure that email notification settings are configured prior to scheduling PDF delivery.
For more information, see Configure email notification settings in the Alerting Manual.
Note: Scheduled PDF delivery is not available for dashboards that include forms or for dashboards converted to HTML.
Splunk software provides tokens that you can use to include information generated by a search in the fields of an email.
For scheduled PDF delivery, you can use tokens in the following fields of an email:
• Subject
• Message
• Footer
$<token-name>$
For example, place the following token in the subject field of a scheduled PDF delivery to reference the app containing the
dashboard.
This section lists common tokens you can use in scheduled email delivery of dashboards. There are four categories of
tokens that access data generated from a search. The context for using the tokens differ.
The following table lists all categories of tokens. For scheduling PDF delivery, only the categories Search metadata and
Server information apply.
164
Category Description Context
Common tokens that access information about a search. These tokens are available for the scheduled PDF delivery of
dashboards.
The following table lists some of the common tokens that are available.
Token Description
$action.email.hostname$ Hostname of the email server.
$type$ Indicates if the search is from an alert, report, dashboard, or the search command.
Common tokens that provide details available from your Splunk platform server. These tokens are available for the
scheduled PDF delivery of dashboards.
The following table lists some of the common tokens that are available.
Token Description
$server.build$ Instance build number.
165
Schedule PDF delivery of a dashboard
1. For the dashboard you want to schedule, select Export > Schedule PDF Delivery.
2. Select the Schedule PDF Delivery check box to enable PDF delivery.
3. Select a schedule
If you select Run on Cron Schedule see cron examples.
4. Specify email details.
You can use tokens in the Subject and Message fields.
1. For the dashboard you want to discontinue PDF delivery, select Export > Schedule PDF Delivery.
2. Deselect the Schedule PDF Delivery.
3. Click Save to save the schedule delivery settings.
Every time you schedule a PDF for delivery, a report called a scheduled view is created. These reports are "hidden," in
that they don't appear in Searches, Reports, and Alerts under Settings; they only appear as a stanza in
166
savedsearches.conf. The naming convention for these reports is _ScheduledView_<dashboard_name>, where
dashboard_name is the name of the corresponding dashboard. You should monitor how many of these searches are
running, especially if you are experiencing problems with concurrent search limits for your deployment.
You can use cron notation to define a custom delivery schedule. Select the Cron option to input a schedule.
Cron parameters
When specifying a cron expression, only five cron parameters are available, not six. The sixth parameter for year,
common in other forms of cron notation, is not available.
Example expressions
Here are some example cron expressions.
Splunk Enterprise users can specify the following configurations for PDF printing.
Note: If you are using Splunk Cloud and want these settings changed, file a Support ticket.
By default, 1000 rows are generated for a simple results table in a dashboard panel. If you have a dashboard with a table
that has more than 1000 rows, the initial 1000 rows are rendered for the PDF, printing the results across several pages if
necessary.
Splunk Enterprise users can override the default number of rows generated for PDF in the limits.conf file.
To configure the maximum number of rows in a table that can be printed in PDF:
[pdf]
max_rows_per_table = <unsigned int>
167
Note: This setting configures PDF settings for all tables in your Splunk deployment.
The default timeout for generating a PDF is 3600 seconds, as specified in limits.conf. A complex search that is slow to
completion might need additional time to generate the PDF.
[pdf]
render_endpoint_timeout = <unsigned int>
Note: This setting configures PDF generation timeout settings for all PDFs in your Splunk deployment.
By default, the Splunk logo is included in a generated PDF. You can override the default setting in alert_actions.conf.
[email]
reportIncludeSplunkLogo=0
Note: This setting configures settings for all generated PDFs in your Splunk deployment.
Splunk software comes prepackaged with a collection of Latin fonts, and also a set of CID fonts for handling Japanese,
Korean, Simplified Chinese, and Traditional Chinese.
You can control how Splunk software loads the CID fonts by making changes to the reportCIDFontList parameter in
alert_actions.conf. Specify fonts in a space-separated list. If multiple fonts provide a glyph for a given character code,
the glyph from the first font in the list is used.
The reportCIDFontList parameter is in the [email] stanza. Make any changes for font usage here:
$SPLUNK_HOME/etc/system/local/alert_actions.conf
gb cns jp kor
These reference Simplified Chinese, Traditional Chinese, Japanese, and Korean respectively.
To skip loading any CID fonts, in the local version of alert_actions.conf, leave the value of reportCIDFontList blank.
168
If you want your PDFs to use another non-Latin font (such as Cyrillic or Greek) ask an administrator add the Unicode font
to $SPLUNK_HOME/share/splunk/fonts. Create the fonts directory if it doesn't already exist.
Note: When multiple fonts are installed, they are sorted by name in alphabetical order. For example, If you have Cyrillic
and Greek installed, Splunk software always chooses Cyrillic unless you change the name of the files in
$SPLUNK_HOME/share/splunk/fonts so that Greek comes first.
• PDFs in languages, such as Hebrew, where text should appear in right to left order, are rendered with text in left
to right order.
• PDFs for dashboards with multiple panels in a row might generate with only a single panel per row.
• You cannot generate PDFs of dashboards that are built using advanced XML or HTML. PDF generation works
only with dashboards built with simple XML.
• You cannot generate PDFs for forms.
• PDF generation ignores charting customizations that are not supported by the JSChart charting library. The
finished PDF displays the panels as rendered in JSChart with the unsupported customizations removed.
You can also adjust caching for deployments with large numbers of dashboards.
Clone a dashboard
Create a copy of a dashboard from the Dashboards page or using the dashboard editor.
Steps
From What to do
1. Locate the dashboard that you want to set as the home dashboard.
2. Select Edit > Clone.
Dashboards page
3. (Optional) Update the cloned dashboard title and id. Provide a
description.
4. Click Clone dashboard.
169
Steps
From What to do
Dashboard editor
1. Click the ... button and select Set as home dashboard.
Splunk Enterprise deployments with several hundred or more dashboards might have slower UI performance.
To improve UI performance, increase the default max_view_cache_size setting in the web.conf configuration file. For
example, for an instance with 700 dashboards, you can increase this setting to 1000.
170
Simple XML Reference
dashboard
Root element of a view. A dashboard contains one or more rows, each of which can display one or more panels.
A dashboard can contain one or more global <search> elements that drive the data displayed in the dashboard. The
<panel> elements can contain one or more <search> elements that drive the data in each panel.
If the dashboard contains a global search, there must be a post-process search in a <panel> element to display data from
the search.
<dashboard>
<init> (0..1)
<label> (0..1)
<description> (0..1)
<search> (0..1)
<row> (1..n)
<panel> (0..n)
<search> (0..n)
<chart> | <event> | <html> | <map> | <single> | <table> (1..n)
<search> (0..n, for each visualization element)
Attributes
Footer: List of links and a copyright notice at the foot of the dashboard.
Splunk Bar: Top bar that provides a link to the home page and access to
Settings pages.
171
Name Type Default Description
Title: The text defined in the <label> and <description> elements of the
dashboard.
For internal use.
onunloadCancelJobs Boolean Specifies whether to cancel search jobs when a user navigates away from a dashboard.
Sets the dashboard refresh interval, in seconds. The dashboard reloads after the specified
refresh Integer 0
refresh interval.
Comma-separated list of custom js files to load. The files must be in a folder or subfolder of the
appserver/static directory.
$SPLUNK_HOME/etc/apps/<app_name>/appserver/static/
script String To reference custom js files from another app, specify the the app name when
referencing the file. For example, use the following reference.
<dashboard script="myApp:myScript.js">
Comma-separated list of custom stylesheets to use for the dashboard. The stylesheet files must
be in a folder or subfolder of the following directory.
$SPLUNK_HOME/etc/apps/<app_name>/appserver/static/
stylesheet text To reference a custom css file from another app, specify the the app name when
referencing the file. For example, use the following reference.
<dashboard stylesheet="myApp:myStyles.css">
Example
A dashboard that contains user input elements. The user input elements supply values for one or more search terms that
are used in searches in the form.
<form>
172
<init> (0..1)
<label> (0..1)
<description> (0..1)
<search> (0..1)
<fieldset> (1)
<input> (1..n)
<row> (1..n)
<panel> (0..n)
<search> (0..n)
<chart> | <event> | <html> | <map> | <single> | <table> (1..n)
<search> (0..n, for each visualization element)
Attributes
Splunk Bar: Top bar that provides a link to the home page and access to
Settings pages.
Title: The text defined in the <label> and <description> elements of the
dashboard.
For internal use.
onUnloadCancelJobs Boolean Specifies whether to cancel search jobs when navigating away from a dashboard.
refresh Integer 0 Sets the refresh interval, in seconds. Dashboard reloads after the specified refresh interval.
Comma-separated list of custom JavaScript files to load. The files must be in the following
location. The files cannot be in a subdirectory.
$SPLUNK_HOME/etc/apps/<app_name>/appserver/static/
script String
To reference the custom JavaScript files from another app, specify the the app
name when referencing the file as follows:
<form script="myApp:myScript.js">
173
Name Type Default Description
Comma-separated list of custom stylesheets to use for the dashboard. The stylesheet files must
be in the following location. The files cannot be in a subdirectory.
$SPLUNK_HOME/etc/apps/<app_name>/appserver/static/
stylesheet Text
To reference a custom stylesheet file from another app, specify the the app
name when referencing the file as follows:
<dashboard stylesheet="myApp:myStyles.css">
Example
174
panel
Two or more visualization elements in a panel group vertically. The exception is the single visualization element. Two or
more single elements group horizontally.
• Inline panel: An inline panel contains one or more visualization elements. You can create and edit an inline panel
with the Dashboard Editor and the Panel Editor. You can also edit the panel in simple XML source code.
• Reference panel: A reference panel displays the contents of a prebuilt panel on a dashboard. A reference panel
contains a ref attribute and an optional app attribute that provide a reference to the prebuilt panel.
A reference panel does not recognize child elements of a <panel> element that you specify in the dashboard XML
code.
You cannot use the Panel Editor to edit the contents of a reference panel.
For more information on prebuilt panels, see Dashboard panels and Create and add a panel by reference.
Attributes
ref Text
References the name of a prebuilt panel. This is the name that appears in
Settings > User Interface > Panels.
(Optional) Applies only to reference panels.
See References the name of the app that contains the reference panel. The
app Text
description. app for a reference panel appears in Settings > User Interface > Panels.
Default value for app is the app that contains the dashboard.
Comma-separated
depends All tokens from the list of tokens must be defined to render this panel in a dashboard.
list of tokens
The following terms are reserved for internal use and cannot be used for
an id.
• dashboard
• search
• default
• submitted
• footer
• url
175
Name Type Default Description
• header
Comma-separated
rejects Prevent panel rendering if one or more tokens in this list are defined.
list of tokens
Parent element
<row>
Inline panel
<row>
<panel> (0..n)
<title> (0..1)
<description> (0..1)
<search> (0..n)
<chart> | <event> | <html> | <map> | <single> | <table> (1..n)
Reference panel
<row>
<panel ref="[panel name]" [app="[app name]"]> (0..n)
<!-- Other <panel> child elements ignored -->
Grouping of chart visualizations and single value visualizations using the <panel> element.
<dashboard>
<label>Dashboard Panel Example</label>
<description></description>
<row>
<panel>
<chart>
<title>Chart grouping</title>
<search>
<query>
index=_internal source="*splunkd.log"
( log_level=ERROR OR log_level=WARN*
176
OR log_level=FATAL OR log_level=CRITICAL )
| stats count as log_events
| rangemap field=log_events low=1-100 elevated=101-300 default=severe
</query>
<earliest>-7d@h</earliest>
<latest>now</latest>
</search>
<option name="charting.chart">radialGauge</option>
</chart>
<chart>
<search>
<query>
index=_internal source="*splunkd.log"
( log_level=ERROR OR log_level=WARN*
OR log_level=FATAL OR log_level=CRITICAL )
| stats count as log_events
| rangemap field=log_events low=1-100 elevated=101-300 default=severe
</query>
<earliest>-7d@h</earliest>
<latest>now</latest>
</search>
<option name="charting.chart">markerGauge</option>
</chart>
</panel>
</row>
<row>
<panel>
<single>
<title>Single value grouping</title>
<search>
<query>
index=_internal source="*splunkd.log"
( log_level=ERROR OR log_level=WARN*
OR log_level=FATAL OR log_level=CRITICAL )
| stats count as log_events
| rangemap field=log_events low=1-100 elevated=101-300 default=severe
</query>
<earliest>-7d@h</earliest>
<latest>now</latest>
</search>
<option name="beforeLabel">Found</option>
<option name="afterLabel">errors</option>
</single>
<single>
<search>
<query>
index=_internal source="*splunkd.log"
( log_level=ERROR OR log_level=WARN*
OR log_level=FATAL OR log_level=CRITICAL )
| stats count as log_events
| rangemap field=log_events low=1-100 elevated=101-300 default=severe
</query>
<earliest>-7d@h</earliest>
<latest>now</latest>
</search>
<option name="beforeLabel">Found</option>
<option name="afterLabel">errors</option>
</single>
</panel>
</row>
</dashboard>
177
row
A container for displaying one or more visualization elements in a horizontal layout of a dashboard or form.
Attributes
grouping comma-separated No Deprecated. Use the <panel> element to group visualization elements.
list of integers grouping
Sets the grouping for the panels in a row according to a comma-separated list of
numbers representing the panels to be grouped. When you group panels, the
visualization for each grouped panel is placed in a container. With one exception,
you can consider the containers as columns for the panel visualizations.
Visualizations are placed one above the other in the container. If the grouping
contains only visualizations of type <single>, the visualizations are placed
side-by-side.
The first number in a grouping configures a group for the initial number of panels
specified for that group. Subsequent numbers in the list form a group for the next
set of panels.
For example, suppose you have a row with 6 visualizations. Specify the following
grouping:
<row grouping="2,1,3">
This creates a container with the first two panels, a second container with one
visualization, and a third container with the last three panels grouped.
178
Name Type Default Description
Only alphanumeric and underscore characters are valid. Cannot begin with a
number or the underscore character.
The following terms are reserved for internal use and cannot be used for an id:
Text (minimum two
id
characters)
• dashboard
• search
• default
• submitted
• footer
• url
• header
Comma-separated
rejects Prevent row rendering if one or more tokens in this list are defined.
list of tokens
Parent elements
<dashboard> | <form>
<row>
<panel> (0..n)
Example
See the example for the <panel> element. This example shows grouping of visualizations in row, using the <panel>
element.
label
Parent element
<dashboard> | <form>
<label>[text]</label> (0..1)
Example
<form>
<label>Event count for different source types</label>
. . .
<fieldset>
<input type="text" token="series">
<label>Enter a source type</label>
<default></default>
<initialValue>splunkd</initialValue>
</input>
</fieldset>
. . .
179
</form>
description
Parent element
Syntax
<description>[text]</description> (0..1)
Example
<dashboard>
<label>Event count for different source types</label>
<description>Listing of common source types</description>
. . .
<panel>
<title>Source types for the last 7 days</title>
<description>Count for each source type in the internal index</description>
. . .
. . .
</dashboard>
init
Use the <init> element to set or update token values when a dashboard or form opens. See Token usage in dashboards
to learn about using the <init> element to set tokens on page load.
Form inputs
fieldset
Attributes
<form>
180
<fieldForLabel> (0..1)
<fieldForValue> (0..1)
<initialValue> (0..1)
<label> (0..1)
<prefix> (0..1)
<search> (0..1)
<selectFirstChoice> (0..1)
<suffix> (0..1)
<populatingSearch> | <populatingSavedSearch> (0..1, deprecated)
Example
Attributes
token String Specifies which token in the search string to replace with the specified value.
Parent element
<fieldset>
181
<suffix> (0..1)
<valuePrefix> (0..1)
<valueSuffix> (0..1)
Child elements
A string that will be placed between each selected value. Typically, you specify " OR " or " AND "
<delimiter> text using upper case – do not specify the quote marks, but specify a space character before and
after the text.
Time expressions that specify the earliest and latest time parameters. Use with the <search>
element to dynamically populate choices for the input.
<earliest>
text
<latest> You can specify the time as relative time or absolute time. For relative time, use
relative time modifiers, as described in Specify time modifiers in your search. For
absolute time, specify the time in UNIX epoch time format.
<fieldForLabel> The field to use for the label and value when using the <search> element to dynamically
text
<fieldForValue> populate choices for the input.
<prefix> text String prefixed to the value of the input element. Can be a regular expression.
Search that dynamically populates choices for the input. Use the ref attribute of the <search>
<search> text
element to reference a search from a report. See <search>.
<suffix> text String appended to the value of the input element. Can be a regular expression.
<valuePrefix> text String prefixed to the value of the input element. Can be a regular expression.
<valueSuffix> text String appended to the value of the input element. Can be a regular expression.
Example
This example produces the following string when a user selects One and Three from the multiselect:
<fieldset>
<input type="checkbox" token="mv5">
<choice value="1">One</choice>
<choice value="2">Two</choice>
<choice value="3">Three</choice>
<delimiter> AND </delimiter>
182
<prefix>(</prefix>
<suffix>)</suffix>
<valuePrefix>"</valuePrefix>
<valueSuffix>*"</valueSuffix>
</input>
</fieldset>
dropdown
Attributes
token String Specifies which token in the search string to replace with the specified value.
Parent element
<fieldset>
Child elements
<change> <condition>
The <change> element is not available for multiselect inputs. See
<change>.
<choice value=[value]> text value: Required. Specifies the value to use for the choice.
183
element Type Default Description
Specifies choices for a radio or dropdown element. <choice> Is the label
to use for the specified value.
Specifies an input choice that sets conditional actions.
<condition> Input choice
See <condition> (input).
<default> Attribute value Specifies a default value for an input element.
Time expressions that specify the earliest and latest time parameters. Use with the
<search> element to dynamically populate choices for the input.
<earliest> You can specify the time as relative time or absolute time. For relative
text
<latest>
time, use relative time modifiers, as described in Specify time modifiers in
your search. For absolute time, specify the time in UNIX epoch time
format.
<fieldForLabel> The field to use for the label and value when using the <search> element to dynamically
text
<fieldForValue> populate choices for the input.
<prefix> text String prefixed to the value of the input element. Can be a regular expression.
Search that dynamically populates choices for the input. Use the ref attribute of the
<search> text
<search> element to reference a search from a report. See <search>.
Indicates if the first item listed is the default item for the input. If a value for <default> is
<selectFirstChoice> boolean false
present, <selectFirstChoice> is ignored.
<form>
<label>Form example: source type time chart</label>
<fieldset autorun="true" submitButton="false">
<input type="dropdown" token="sourcetype_tok">
<label>Select a source type</label>
<default>splunkd</default>
<choice value="splunkd">splunkd</choice>
<choice value="splunk_web_access">splunk_web_access</choice>
<choice value="splunkd_ui_access">splunkd_ui_access</choice>
</input>
</fieldset>
<row>
<panel>
<chart>
<search>
<query>
184
index = _internal sourcetype=$sourcetype_tok$
| timechart count by sourcetype
</query>
<earliest>-7d</earliest>
<latest>-0d</latest>
</search>
</chart>
</panel>
</row>
</form>
link
Attributes
token String Specifies which token in the search string to replace with the specified value.
Parent element
<fieldset>
185
<label> (0..1)
<default> (0..1)
<prefix> (0..1)
<search> (0..1)
<selectFirstChoice> (0..1)
<suffix> (0..1)
Child elements
Time expressions that specify the earliest and latest time parameters. Use with the
<search> element to dynamically populate choices for the input.
<earliest> You can specify the time as relative time or absolute time. For relative
text
<latest>
time, use relative time modifiers, as described in Specify time modifiers in
your search. For absolute time, specify the time in UNIX epoch time
format.
<fieldForLabel> The field to use for the label and value when using the <search> element to dynamically
text
<fieldForValue> populate choices for the input.
<prefix> String String prefixed to the value of the input element. Can be a regular expression.
Search that dynamically populates choices for the input. Use the ref attribute of the
<search> text
<search> element to reference a search from a report. See <search>.
Indicates if the first item listed is the default item for the input. Overrides any value for
<selectFirstChoice> boolean false
<initialValue>. If a value for <default> is present, <selectFirstChoice> is ignored.
<suffix> String String appended to the value of the input element. Can be a regular expression.
Example
<form>
<label>Form with Link Selector</label>
<description></description>
<fieldset autoRun="True" submitButton="false">
<input type="link" token="field_tok">
<label>Select field to analyze</label>
186
<default>Reason</default>
<choice value="reason">Reason</choice>
<choice value="log_level">Log level</choice>
<choice value="component">Component</choice>
</input>
</fieldset>
<row>
<panel>
<chart>
<title>Log level by $field_tok$</title>
<search>
<query>index=_internal source=*splunkd.log | stats count by $field_tok$</query>
<earliest>-30d</earliest>
<latest>now</latest>
</search>
<option name="charting.axisY.scale">log</option>
<option name="charting.chart">bar</option>
</chart>
</panel>
</row>
</form>
multiselect
Defines an input to a form that accepts multiple choices. When a user selects the input, defined choices appear as a
dropdown list. The user can also type directly in the input to filter the available choices.
Attributes
token text Specifies which token in the search string to replace with the specified value.
Parent element
<fieldset>
187
<search> (0..1)
<suffix> (0..1)
<valuePrefix> (0..1)
<valueSuffix> (0..1)
Child elements
A string that will be placed between each selected value. Typically, you specify " OR " or "
<delimiter> text AND " using upper case – do not specify the quote marks, but specify a space character
before and after the text.
Time expressions that specify the earliest and latest time parameters. Use with the
<search> element to dynamically populate choices for the input.
<earliest> You can specify the time as relative time or absolute time. For relative
text
<latest>
time, use relative time modifiers, as described in Specify time modifiers in
your search. For absolute time, specify the time in UNIX epoch time
format.
<fieldForLabel> The field to use for the label and value when using the <search> element to dynamically
text
<fieldForValue> populate choices for the input.
<prefix> text String prefixed to the value of the input element. Can be a regular expression.
Search that dynamically populates choices for the input. Use the ref attribute of the
<search> text
<search> element to reference a search from a report. See <search>.
<suffix> text String appended to the value of the input element. Can be a regular expression.
<valuePrefix> text String prefixed to the value of the input element. Can be a regular expression.
<valueSuffix> text String appended to the value of the input element. Can be a regular expression.
Example
This example produces the following multiselect string for the search when a user selects splunkd and
splunk_web_access:
<form>
<label>Form with multiselect</label>
<fieldset autoRun="false" submitButton="true">
<html>
<strong>Multiselect choices</strong>
</html>
<input type="multiselect" token="sourcetype_tok" searchWhenChanged="false">
<label>Select one or more source types</label>
188
<choice value="*">All</choice>
<choice value="splunk_web_access">splunk_web_access</choice>
<choice value="splunkd">splunkd</choice>
<choice value="splunk_ui_access">splunk_ui_access</choice>
<choice value="splunkd_access">splunkd_access</choice>
</input>
</fieldset>
<row>
<panel>
<title></title>
<chart>
<search>
<query>index =_internal $sourcetype_tok$ | stats count by sourcetype</query>
<earliest>-24h</earliest>
<latest>now</latest>
</search>
<option name="charting.chart">line</option>
<option name="charting.axisY.scale">log</option>
</chart>
</panel>
</row>
</form>
189
radio
Attributes
token String Specifies which token in the search string to replace with the specified value.
Parent element
<fieldset>
Child elements
<earliest> text Time expressions that specify the earliest and latest time parameters. Use with the
<latest> <search> element to dynamically populate choices for the input.
190
element Type Default Description
You can specify the time as relative time or absolute time. For relative
time, use relative time modifiers, as described in Specify time modifiers in
your search. For absolute time, specify the time in UNIX epoch time
format.
<fieldForLabel> The field to use for the label and value when using the <search> element to dynamically
text
<fieldForValue> populate choices for the input.
<prefix> String String prefixed to the value of the input element. Can be a regular expression.
Search that dynamically populates choices for the input. Use the ref attribute of the
<search> text
<search> element to reference a search from a report. See <search>.
Indicates if the first item listed is the default item for the input. If a value for <default> is
<selectFirstChoice> boolean false
present, <selectFirstChoice> is ignored.
<suffix> String String appended to the value of the input element. Can be a regular expression.
Example
<form>
<label>Form with radio input</label>
<description></description>
<fieldset autoRun="True" submitButton="false">
<input type="radio" token="field_tok">
<label>Select field to analyze</label>
<default>component</default>
<choice value="reason">Reason</choice>
<choice value="name">Name</choice>
<choice value="component">Component</choice>
</input>
</fieldset>
<row>
<panel>
<chart>
<title>Log level by $field_tok$</title>
<search>
<query>
index=_internal source=*splunkd.log | stats count by $field_tok$
</query>
<earliest>-30d</earliest>
<latest>now</latest>
</search>
<option name="charting.axisY.scale">log</option>
<option name="charting.chart">bar</option>
</chart>
</panel>
</row>
</form>
191
text
Attributes
token String Specifies which token in the search string to replace with the specified value.
Parent element
<fieldset>
192
Child elements
<prefix> String String prefixed to the value of the input element. Can be a regular expression.
<suffix> String String appended to the value of the input element. Can be a regular expression.
Example
<form>
<label>Form with text input</label>
<description></description>
<fieldset autoRun="True" submitButton="false">
<input type="text" token="log_level_tok">
<label>Specify a log level</label>
<default>INFO</default>
</input>
</fieldset>
<row>
<panel>
<chart>
<title>Timechart for $log_level_tok$</title>
<search>
<query>
index=_internal source=*splunkd.log log_level="$log_level_tok$"
| timechart count by log_level
</query>
<earliest>-7d</earliest>
<latest>now</latest>
</search>
<option name="charting.axisY.scale">log</option>
<option name="charting.chart">line</option>
</chart>
</panel>
</row>
</form>
193
time
Use tokens to specify more than one time range picker. If you do not specify a token for a time picker, the time picker
becomes global. Any visualization that does not specify a time range, either through a reference to a time picker token or
directly in code, applies the time range from the global time picker.
Attributes
token text When referencing a time picker token, use the earliest and latest
modifiers to the token to specify a time range. See the example
below.
searchWhenChanged Boolean False Specifies to run the search upon a new selection.
Parent element
<fieldset>
194
<default> (0..1)
[time preset] (0..1) |
<earliest> (0..1)
<latest> (0..1)
</default>
Child elements
<earliest>
text You can specify the time as relative time or absolute time. For relative time, use
<latest>
relative time modifiers, as described in Specify time modifiers in your search. For
absolute time, specify the time in UNIX epoch time format.
Specifies a default value for an input element.
text
You can specify either a preset value, as listed in times.conf,
or
<default> or
time
the <earliestTime> and <latestTime> for a custom default time range.
modifier
See <earliestTime> and <latestTime> for details.
<label> text Text displayed with the input element.
Example
The default value for the time picker is set to the last seven days. The <chart> element in this example references the
$time_tok$ token for the time picker. The chart updates with any new selected time range.
<form>
<label>Form with time input</label>
<description/>
<fieldset submitButton="false">
<input type="dropdown" token="source_tok" searchWhenChanged="true">
<label>Select a source type</label>
<choice value="*">All</choice>
<search>
<query>
index=_internal | stats count by sourcetype
</query>
<earliest>-7d@h</earliest>
<latest>now</latest>
</search>
<fieldForLabel>sourcetype</fieldForLabel>
<fieldForValue>sourcetype</fieldForValue>
<prefix>sourcetype="</prefix>
195
<suffix>"</suffix>
<default>*</default>
</input>
<input type="time" token="time_tok" searchWhenChanged="true">
<label>Select time range</label>
<default>
<earliest>-7d@h</earliest>
<latest>now</latest>
</default>
</input>
</fieldset>
<row>
<panel>
<chart>
<title>$source_tok$ -- Count for last 7 days</title>
<search>
<query>
index=_internal $source_tok$ | timechart count
</query>
<earliest>$time_tok.earliest$</earliest>
<latest>$time_tok.latest$</latest>
</search>
<option name="charting.chart">column</option>
</chart>
</panel>
</row>
</form>
196
change
Parent elements
<input type="checkbox">
<input type="dropdown">
<input type="radio">
<input type="text">
<input type="time">
<change>
<condition>(0..n)
(<link> | <set> | <unset>) (1..n)
Attributes
Example
Use the <change> element to capture the selected label and value from an input.
<form>
<label>Use tokens with input choices to capture input labels and values</label>
<fieldset submitButton="false">
<input type="radio" token="period_tok">
<label>Select a time range</label>
<choice value="-24h@h">Last 24 Hours</choice>
<choice value="-7d@d">Last 7 Days</choice>
<choice value="-30d@d">Last 30 Days</choice>
<default>Last 24 Hours</default>
<change>
<!-- use predefined input tokens to set -->
<!-- tokens for the selected label and value -->
<set token="date_label">$label$</set>
<set token="earliest_tok">$value$</set>
</change>
</input>
</fieldset>
<row>
<panel>
<title>Conditional Inputs</title>
<chart>
<!-- Display selected label in the title -->
<title>Source Type by $date_label$</title>
<search>
<query>index = _internal | timechart count by sourcetype</query>
<!-- use the value of earliest_tok -->
<!-- to set the time range -->
<earliest>$earliest_tok$</earliest>
<latest>now</latest>
</search>
<option name="charting.axisY.scale">log</option>
<option name="charting.axisTitleX.text">Time period</option>
197
<option name="charting.axisTitleY.text">Events</option>
</chart>
</panel>
</row>
</form>
condition (input)
Specifies the scope of actions based on input choices. If the parent element <change> is not present, then the actions
apply to all choices. The <condition> element is not available for multiselect inputs.
Note: The <condition> element applies to both input elements and drilldown elements. See <condition> (drilldown) for
details.
Attributes
<change>
<condition>
(<link> | <set> | <unset>) (1..n)
198
Example
The token for the selected choice appears in the title for the chart. The conditional token for the selected value drives the
data for the chart.
<form>
<label>Use tokens with conditional input choices</label>
<fieldset submitButton="false">
<input type="radio" token="period_tok">
<label>Select a time range</label>
<choice value="-24h@h">Last 24 Hours</choice>
<choice value="-7d@h">Last 7 Days</choice>
<choice value="-30d@h">Last 30 Days</choice>
<default>Last 24 Hours</default>
<search>
<query>index = _internal | timechart count by sourcetype</query>
<!-- use the value of earliest_tok -->
<!-- to set the time range -->
<earliest>$earliest_tok$</earliest>
<latest>now</latest>
</search>
<option name="charting.axisY.scale">log</option>
<option name="charting.axisTitleX.text">Time periods</option>
<option name="charting.axisTitleY.text">Events</option>
</chart>
</panel>
</row>
199
</form>
chart
A panel displaying search data in chart format. The search driving the panel can be an inline search or a saved report,
which contains chart formatting parameters. For more information on saving reports, see Create and edit reports.
When you load a saved report in the chart panel, your saved report format also loads. However, you can override chart
formatting inline using the chart options.
Charts use named options to specify chart-specific properties. This reference lists the basic panel options for charts. See
the Chart Configuration Reference for a complete list of chart options.
Attributes
The following terms are reserved for internal use and cannot be used for an
id.
• dashboard
• search
• default
• submitted
• footer
200
Name Type Default Description
• url
• header
Prevent visualization rendering if one or more tokens in this list are defined.
Comma-separated
rejects
list of tokens Tokens can be from the context of form inputs or from the context of in-page
drilldown.
Parent elements
<row>
<panel>
<chart>
<title> (0..1)
<search> (0..1)
<earliest> (0..1)
<latest> (0..1)
<drilldown> (0..n)
<selection> (0..n, for charts of type area, line, and column only)
<option name="[property]"> (0..n)
Options
link.openSearch.searchEarliestTime (time modifier) (See The earliest time to use for the alternative search
description) specified by link.openSearch.search.
201
property Type Default Description
Default value: The earliest time used by the
panel.
link.openSearch.viewTarget View name Search The target view for the Open in Search button.
refresh.time.visible Boolean true Display the refresh time indicator in the panel.
Example line chart panel using an inline search. It limits results to a specified time window and provides labels for the X
and Y axes:
<dashboard>
<label>Top source types in the last week</label>
<row>
<panel>
<title>Chart example</title>
<chart>
<title>Top sourcetypes in the last week</title>
<search>
<query>
index=_internal source="*metrics.log" group=per_sourcetype_thruput
| timechart sum(kb) by series
</query>
<earliest>-1w</earliest>
<latest>now</latest>
</search>
<option name="height">200</option>
<option name="charting.chart">line</option>
202
<option name="charting.axisY.scale">log</option>
<option name="charting.chart.nullValueMode">connect</option>
</chart>
</panel>
. . .
</row>
</dashboard>
event
Attributes
Only alphanumeric and underscore characters are valid. Cannot begin with a
number or the underscore character.
The following terms are reserved for internal use and cannot be used for an
Text (minimum two id.
id
characters)
• dashboard
• search
• default
• submitted
• footer
• url
• header
Prevent visualization rendering if one or more tokens in this list are defined.
Comma-separated
rejects
list of tokens Tokens can be from the context of form inputs or from the context of in-page
drilldown.
203
Parent elements
<row>
<panel>
<event>
<title> (0..1)
<search> (0..1)
<earliest> (0..1)
<latest> (0..1)
<fields> (0..1)
<option name="[property]"> (0..n)
Options
link.openSearch.searchEarliestTime (time modifier) (See The earliest time to use for the alternative search specified by
description) link.openSearch.search.
204
property Type Default Description
See Specify time modifiers in your search for
information on specifying time modifiers.
The latest time to use for the alternative search specified by
link.openSearch.search.
link.openSearch.viewTarget View name Search The target view for the Open in Search button.
maxLines Integer The maximum number of lines to display for each result/event.
refresh.time.visible Boolean true Display the refresh time indicator in the panel.
205
property Type Default Description
refresh.link.visible Boolean true Display the refresh link in the panel.
table.sortColumn text Specifies the column on which to sort for the table.
table.sortDirection (asc | desc) asc Indicates the sort direction for items in the table.
type (list | raw | table) list Indicates the format for displaying events.
Example
<dashboard>
<label>Event listing by size</label>
<row>
<panel>
<title>Event example</title>
<event>
<title>Event view</title>
<search>
<query>
index = _internal current_size_kb < 1
</query>
<earliest>-1w</earliest>
<latest>now</latest>
</search>
<option name="showPager">true</option>
<option name="count">4</option>
<option name="rowNumbers">false</option>
</event>
</panel>
</row>
</dashboard>
206
html
The HTML panel displays inline HTML. The panel interprets the entire contents between the HTML tags literally,
displaying HTML formatted text in the panel.
Any relative link references, such as images, are relative to the current view location. The HTML panel does not accept
any options.
Attributes
Only alphanumeric and underscore characters are valid. Cannot begin with a
number or the underscore character.
The following terms are reserved for internal use and cannot be used for an id.
Text (minimum two
id
characters)
• dashboard
• search
• default
• submitted
• footer
• url
• header
Prevent visualization rendering if one or more tokens in this list are defined.
comma-separated
rejects
list of tokens Tokens can be from the context of form inputs or from the context of in-page
drilldown.
src String
207
Name Type Default Description
Put the contents of an HTML or image file into the <html> panel. Directory locations and Simple
XML syntax are different for HTML files and image files.
<html src="<file_name>.html">
</html>
<html src="<other_app_name>:<file_name>.html">
</html>
Image file
<html>
<img src="/static/app/<app_name>/images/<file_name>.png">
</img>
</html>
See the following instructions for details on where to save HTML and image files
and how to reference files from different app contexts.
tokens boolean true If false, disables token replacement for the <html> panel.
Steps
If you are specifying an HTML file from another app context, use this syntax.
<html src="<other_app_name>:<file_name>.html">
</html>
Steps
If an /images directory does not already exist, create one and put the file in it.
2. Verify that the image file path is accessible by testing the following URL.
http://<host>:<port>/static/app/<app_name>/images/<image>
208
For example, use this URL to verify that the my_image.png file is accessible.
http://localhost:8000/static/app/search/images/my_image.png
3. In the <html> panel, use this syntax to indicate a file from the current app context.
<html>
<img src="/static/app/search/images/<file_name>.png">
</img>
</html>
Example
<dashboard>
<label>test_db</label>
<row>
<panel>
<html>
<!-- Use an image from the current app's /static/images directory -->
<img src="/static/app/search/images/my_image.png"></img>
</html>
</panel>
<panel>
<!-- Use an HTML file from the webhook app. -->
<html src="alert_webhook:my_html_file.html">
</html>
<!--Use an image from the webhook app static/images directory -->
<html>
<img src="/static/app/alert_webhook/images/my_other_image.png"></img>
</html>
</panel>
</row>
</dashboard>
Parent elements
<row>
<panel>
<html>
Example
<dashboard>
<label>Dashboard with HTML content</label>
<row>
<panel>
<title>HTML panel</title>
<html>
<h1>Example HTML</h1>
<p>The HTML panel displays inline HTML.</p>
<p>
The panel interpets the entire contents between the HTML tags literally, displaying
HTML formatted text in the panel. The HTML panel does not accept any options.
</p>
<p>
209
Any relative link references, such as images,
are relative to the current view location.
</p>
<p>
For the following image in the Search app: <img src="/static/app/search/appIcon.png"/>
</p>
<p>Path to the image in your Splunk instance:
<pre>$SPLUNK_HOME/etc/apps/search/appserver/static/appIcon.png</pre>
Access the image with the following HTML source code:
<pre><img src="/static/app/search/appIcon.png" /></pre>
</p>
</html>
</panel>
<panel>
<title>HTML from source file</title>
<html src="Test_for_html_panel.html" />
</panel>
</row>
</dashboard>
map
Provides for mapping geographic coordinates as interactive markers on a world map. This visualization depends on
results from the geostats search command.
See "geostats" in the Search Reference for details on implementing a geostats search.
You can create choropleth maps with the <map> element. See Choropleth maps. For choropleth map simple XML options,
see Choropleth map options.
Attributes
210
Name Type Default Description
Text (minimum two Only alphanumeric and underscore characters are valid. Cannot begin with a
characters) number or the underscore character.
The following terms are reserved for internal use and cannot be used for an
id.
• dashboard
• search
• default
• submitted
• footer
• url
• header
Prevent visualization rendering if one or more tokens in this list are defined.
comma-separated
rejects
list of tokens Tokens can be from the context of form inputs or from the context of in-page
drilldown.
Parent elements
<row>
<panel>
<map>
<title> (0..1)
<search> (0..1)
<earliest> (0..1)
<latest> (0..1)
<option name="[property]"> (0..n)
Options
link.openSearch.searchEarliestTime (time modifier) (See The earliest time to use for the alternative search specified by
description) link.openSearch.search.
211
property Type Default Description
Default value: The earliest time used by the panel.
link.openSearch.viewTarget View name Search The target view for the Open in Search button.
The initial center point of the map. Latitude values can range from
-85 to 85, with values outside of this range being clipped. Longitude
mapping.map.center (lat,long)
values can range from -180 to 180, with values outside of this range
being wrapped to fall within it.
mapping.map.scrollZoom Boolean false Indicates whether the map zooms when a user scrolls the map.
mapping.map.panning Boolean true Indicates whether the map pans when dragged.
The initial bounds to fit within the map view area. Latitude values
can range from -85 to 85, with values outside of this range being
clipped.
(south-lat,
west-long, Longitude values can range from -180 to 180, with
mapping.map.fitBounds values outside of this range being wrapped to fall within
north-lat,
east-long) it.
212
property Type Default Description
The opacity of the markers. Values can range from 0 (transparent)
to 1 (opaque).
mapping.showTiles boolean true Determines whether the map tiles are shown.
mapping.tileLayer.maxZoom Integer 7
Use any non-negative integer to specify the maximum
zoom level.
Whether to invert the y coordinate for tile requests. TMS servers use
mapping.tileLayer.invertY Boolean False
inverse y-axis numbering.
refresh.time.visible Boolean true Display the refresh time indicator in the panel.
[0x6CB8CA,0xFAC61D,0xD85E3D,0x956E96,0xF7912C,0x9AC23C,0x5479AF,0x999755,0xDD87B0,0x65AA82,
0xA7D4DF,0xFCDD77,0xE89E8B,0xBFA8C0,0xFABD80,0xC2DA8A,0x98AFCF,0xC2C199,0xEBB7D0,0xA3CCB4,
0x416E79,0x967711,0x823825,0x59425A,0x94571A,0x5C7424,0x324969,0x5C5B33,0x85516A,0x3D664E]
213
Choropleth map options
mapping.showTiles Boolean true Determines whether the map tiles are shown.
<map>
<option name="mapping.data.maxClusters">250</option>
</map>
mapping.fieldColors and mapping.seriesColors example
The following example configures the "foo" and "bar" fields to be red (0xFF0000) and green (0x00FF00), respectively, and
configures all other fields to be blue (0x0000FF):
<map>
<option name="mapping.fieldColors">{foo:0xFF0000,bar:0x00FF00}</option>
<option name="mapping.seriesColors">[0x0000FF]</option>
</map>
mapping.map.fitBounds example
The following example initializes the map view to a boundary around San Francisco:
<map>
<option name="mapping.map.fitBounds">
(37.5,-123,38,-122)
</option>
</map>
214
mapping.tileLayer.* example
The following example configures the client to request tiles from openstreetmap.org (this is the default configuration):
<map>
<option name="mapping.tileLayer.url">http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png</option>
<option name="mapping.tileLayer.subdomains">[a,b,c]</option>
<option name="mapping.tileLayer.maxZoom">18</option>
<option name="mapping.tileLayer.attribution">
Map data (c) 2012 OpenStreetMap contributors, CC-BY-SA.
</option>
</map>
map example, using foursquare data
This example assumes you are indexing foursquare data as source foursquare. It produces the map depicted below.
<map>
<title>Roma</title>
<search>
sourcetype=foursquare
| geostats latfield=checkin.geolat longfield=checkin.geolong count by checkin.user.gender
</search>
<option name="mapping.data.maxClusters">500</option>
<option name="mapping.markerLayer.markerMaxSize">20</option>
<option name="mapping.map.fitBounds">(41.3,12.7,41.5,12.8)</option>
<option name="mapping.seriesColors">[0x0060DD]</option>
<option name="mapping.map.zoom">4</option>
</map>
215
single
Element for a single value visualization. This visualization type shows results for a search returning a single discrete
value.
If you specify a search that returns multiple values, the single value panel displays the value from either the first row or
first column of returned search data.
Attributes
Only alphanumeric and underscore characters are valid. Cannot begin with a
number or the underscore character.
The following terms are reserved for internal use and cannot be used for an
Text (minimum two id.
id
characters)
• dashboard
• search
• default
• submitted
• footer
• url
• header
Prevent visualization rendering if one or more tokens in this list are defined.
Comma-separated
rejects
list of tokens Tokens can be from the context of form inputs or from the context of in-page
drilldown.
Parent elements
• <row>
♦ <panel>
Element structure
<single>
<title> (0..1)
<search> (0..1)
<earliest> (0..1)
<latest> (0..1)
<option name="[property]"> (0..n)
Options
216
Deprecated. Use the Format menu in Splunk Web to
additionalClass CSS class name configure single value visualization ranges and color
mapping.
link.openSearch.searchEarliestTime (time modifier) (See description) The earliest time to use for the alternative search
specified by link.openSearch.search.
217
elevated: yellow |
guarded: blue | low: rangeValues appear dark gray if metric falls within that
green) range.
refresh.time.visible boolean true Display the refresh time indicator in the panel.
Attributes
218
Name Type Default Description
Comma-separated Tokens can be from the context of form inputs or from the context of in-page
list of tokens drilldown.
Identifier for the visualization.
Only alphanumeric and underscore characters are valid. Cannot begin with a
number or the underscore character.
The following terms are reserved for internal use and cannot be used for an
Text (minimum two id.
id
characters)
• dashboard
• search
• default
• submitted
• footer
• url
• header
Prevent visualization rendering if one or more tokens in this list are defined.
comma-separated
rejects
list of tokens Tokens can be from the context of form inputs or from the context of in-page
drilldown.
Parent elements
<row>
<panel>
<table>
<title> (0..1)
<search> (0..1)
<earliest> (0..1)
<latest> (0..1)
<fields> (0..1)
<drilldown> (0..n)
<format type="sparkline" field="[field name]"> (0..n)
<option name="[property]"> (0..n)
Child element
(heatmap |
dataOverlayMode None Indicates which type of overlay to display.
highlow)
219
property Type Default Description
displayRowNumbers Boolean True (Deprecated) Use the rowNumbers attribute.
link.openSearch.viewTarget View name Search The target view for the Open in Search button.
220
property Type Default Description
refresh.time.visible Boolean true Display the refresh time indicator in the panel.
totalsRow Boolean false Add a column totals summary row to the table.
Example of a table panel using an inline search, displaying five rows, and disabling row numbers:
<dashboard>
<label>Dashboard with Table</label>
<row>
<panel>
<table>
<title>Top source types in the last 24 hours</title>
<search>
<query>
index=_internal group=per_sourcetype_thruput
| chart sum(kb) by series | sort -sum(kb)
</query>
<earliest>-24h</earliest>
<latest>now</latest>
</search>
<option name="count">5</option>
<option name="rowNumbers">0</option>
</table>
</panel>
</row>
</dashboard>
221
title
Specifies text for the title of a <panel> element or the title for visualization elements.
Attributes
Parent elements
<panel>
<panel>
<title> (0..1) <!-- Title at panel level -->
<chart> | <event> | <html> | <map> | <single> | <table> (1..n)
<title> (0..1) <!-- Title at visualization level -->
Examples
<panel>
<title>Top sourcetypes in the last 24 hours</title>
<table>
<search>
<query>
index=_internal group=per_sourcetype_thruput
| chart su(kb) by series | sort -sum(kb)
</query>
<earliest>-24h</earliest>
<latest>now</latest>
</search>
<option name="count">5</option>
<option name="rowNumbers">0</option>
</table>
</panel>
Specify a title for the <table> visualization:
<panel>
<table>
<title>Top sourcetypes in the last 24 hours</title>
<search>
<query>
index=_internal group=per_sourcetype_thruput
| chart su(kb) by series | sort -sum(kb)
</query>
<earliest>-24h</earliest>
<latest>now</latest>
</search>
<option name="count">5</option>
<option name="rowNumbers">0</option>
</table>
</panel>
222
Sparkline options
Note: for sparklines with single value visualizations, see the "<single>" subheading in this topic.
Attributes
type String sparkline Required. sparkline is the only type supported. Specifies that a sparkline is being formated.
A set of formatting options that determines how sparklines display in tables. Sparkline options are only applicable to the
<table> element. Specify a sparkline option using the <format> element within a <table> element.
Do not confuse the sparkline options here, which format a sparkline, with the sparkline function to the chart or stats
search command. The formatting options listed here require a search that uses the sparkline() function. See Add
sparklines to search results for information on implementing sparklines.
Caution: The sparkline options listed in this reference do not render when generating a PDF of a dashboard. Only the
sparkline itself renders.
Parent elements
<table>
<table>
<format type="sparkline" field=["field name]"> (0..n)
<option name="[property name]"> (0..n)
Common options
height CSS style auto Height of the chart. Specify any valid CSS width (for example, 1.5em, 20px).
223
Property Type Default Description
tooltipSuffix text Text to append to each field displayed in a tooltip.
colorMap See description Range map to map specific values to selected colors.
For example if you want all values of -2 to appear yellow, use colorMap: { '-2': '#ff0' }.
You can pass an array of values here instead of a mapping to specifiy a color for each individual bar. For example if your
chart has three values 1,3,1 you can set colorMap=["red", "green", "blue"].
thresholdValue CSS color Draw values less than this using thresholdColor instead of lineColor
Options for line charts
CSS color for the vertical line that appears through a value when moused over.
highlightLineColor CSS color #f22
Set to null to disable.
Color for the spot that appears on a value when moused over.
highlightSpotColor CSS color #f5f
Set to null to disable.
Used by line and discrete charts to specify the color of the line drawn as a CSS values
lineColor CSS style
string
224
Property Type Default Description
With normalRangeMin, threshold values between which to draw a bar to denote the
"normal" or expected range of values.
range (see
normalRangeMax
description) For example the green (normal) bar in this range
80,85,84,88,98,114,116,104,95,85,84 might denote a normal operating
temperature range.
With normalRangeMax, threshold values between which to draw a bar to denote the
"normal" or expected range of values.
range (see
normalRangeMin
description) For example the green (normal) bar in this range
80,85,84,88,98,114,116,104,95,85,84 might denote a normal operating
temperature range.
CSS color of the final value marker.
spotColor CSS color
Set to false or an empty string to hide it.
spotRadius Number 1.5 Radius, in pixels, of all spot markers.
Points on which to draw spots, and with which color. Accepts a range.
range (see
valueSpots
description) For example, to render green spots on all values less than 50 and red on
values higher use {':49': 'green, '50:': 'red'}
Width of the chart. Specify any valid CSS width (for example, 1.5em, 20px). This option
width CSS style auto
does apply to bar and tristate type sparklines.
Example
<dashboard>
<label>Sparkline Example</label>
<row>
<panel>
<table>
<title>Basic Sparkline Bar w/ Color Map</title>
<!-- Set span for each sparkline datapoint to be 1 hour -->
<search>
<query>
index=_internal | chart count sparkline(count, 1h) as trend by sourcetype | sort -count
</query>
<earliest>-24h@h</earliest>
<latest>now</latest>
</search>
<option name="count">3</option>
<!-- Set sparkline options here; make sure that field matches field name of the search results -->
225
<option name="barWidth">5px</option>
</format>
</table>
</panel>
</row>
</dashboard>
fields
Comma-separated list of fields. Use the <fields> element to restrict searches to these fields.
Fields determine the columns in a table. Field names and values appear with each event in a list. The order of the fields in
the comma-separated list determines the order of the columns in the table or event listing.
Parent elements
<event> <table>
<event> | <table>
<fields> (0..1)
Example
Restrict the results of the search to the following fields: _time, splunkd, splunk_web_access, splunk_web_service
<dashboard>
<label>Fields Example</label>
<row>
<panel>
<table>
<search>
<query>
index=_internal | timechart count by sourcetype
</query>
<earliest>-7d@d</earliest>
<latest>now</latest>
</search>
<fields>_time, splunkd, splunk_web_access, splunk_web_service</fields>
<option name="rowNumbers">0</option>
</table>
226
</panel>
</row>
</dashboard>
option
The <option> tag applies a specific property to an element, such as a panel element. Use the name attribute to specify the
property.
Typically, named options apply to a specific panel. However some options can be applied to more than one panel.
Attributes
Example
<table>
<title>Top sourcetypes in the last 24 hours</title>
<search>
index=_internal group=per_sourcetype_thruput | chart sum(kb) by series | sort -sum(kb)
</search>
<earliestTime>-1d</earliestTime>
<latestTime>now</latestTime>
<option name="count">5</option>
<option name="rowNumbers">0</option>
227
</table>
search element
Use the search element to create searches for <dashboard>, <form>, and panel visualization elements. You also use the
search element to populate choices for form inputs.
search
Defines a search for a dashboard, form, or panel. For form inputs, defines dynamic choices for the inputs.
• Inline search: A search specified in a visualization. Use the <query> element to specify an inline search.
• Reports: A search referenced from a report. Use the ref attribute to reference a report. The panel contains a
visualization that is based on both the search and visualization from the referenced report. You cannot modify the
search but you can change and configure the visualization for the search results. If the search in the report
changes, the panel based on that report updates to include the changes.
• Populating search for input: A search that populates choice for a form input. Use search as a child element of a
form input to populate choices for checkbox, dropdown, multiselect, and radio inputs. The populating search uses
the form input child elements, <fieldForLabel> and <fieldForValue>, to populate the choices. Do not use
real-time searches for populating searches. The input choices do not update correctly when using a real-time
search.
• Global searches: A search from the <dashboard> or <form> context is a global search. Use a global search as the
base search for post-process searches. A global search should always have an id attribute that a post-process
search can reference.
• Post-process searches: A search that further modifies results from a base search. Use the base and id
attributes to implement post-process searches. A post-process search uses the base attribute to reference the id
attribute of the base search. The base search can be a global search or a search at the panel level. Specify
<earliest> and <latest> elements with the base search. The post-process search ignores <earliest> and
<latest> elements that are child elements to the post-process search.
Caution: Passing a large number of search results from a base search can cause a server time out. In this
scenario, consider reducing the following.
◊ The number of results and fields returned from the base search.
◊ The complexity of the post-process operations on these results.
For more information on post-process searches, see Post-process searches in this manual.
Attributes
app text
Use the app attribute with the ref attribute to reference a report that is not in the
current app.
A reference to a base search by a post-process search.
base text
Reference a base search in the current dashboard by the id attribute of the
search.
id Text (minimum two Identifier for a search. A post-process search references a base search by this identifier.
characters)
228
Name Type Default Description
Only alphanumeric and underscore characters are valid. Cannot begin with a
number or the underscore character.
The following terms are reserved for internal use and cannot be used for an id:
• dashboard
• default
• footer
• header
• search
• submitted
• url
ref text
If you are referencing a report in another app, use the app attribute to specify the
app.
Parent elements
Child elements
Execute actions based on finished search events. Includes job properties and first
<done> N/A N/A
result row.
<error> N/A N/A Execute actions when there is a search error event, such as an invalid query.
Optional time expressions that specify the earliest and latest time parameters for a
search.
<earliest> and You can specify the time as relative time or absolute time. For relative time, use
text
<latest> relative time modifiers, as described in Specify relative time ranges in your search in
the Search Manual. For absolute time, specify the time in UNIX epoch time format.
Note: UNIX epoch time format for absolute time in Simple XML is
different from the SPL absolute time format used in queries.
Execute an action on search progress events. Access job properties and the first
<progress>
results row.
229
Element Type Default Description
<query> text Search string for the query.
Indicate a delay or interval time for inline or saved searches. This setting does not
apply to post-process searches, which refresh automatically when their base search
refreshes.
Integers are handled as seconds. Use SPL syntax for relative time expressions. For
Integer or relative time example, 1h5m or 5m.
<refresh> No refresh
expression
Use the <refreshType> setting to specify refresh behavior in relation to search
completion or dispatch.
Indicate the starting time for counting down to a refresh. Use delay to start counting
when the search is done.
<refreshType> interval or delay delay
Use interval to count down when the search is dispatched. If the runtime of the
search is longer than the configured time, the search job is cancelled and a new job
is dispatched.
Event sampling ratio. To learn more, see Event sampling with reports and
<sampleRatio> number
dashboard panels in the Search Manual.
Base search from inline search
Post-process search
Examples
<dashboard>
<label>Dashboard with post-process search</label>
<description></description>
<!-- Example uses stats transforming command -->
<!-- This limits events passed to post-process search -->
<search id="baseSearch">
<query>
index=_internal source=*splunkd.log | stats count by component, log_level
230
</query>
<earliest>-30d</earliest>
<latest>now</latest>
</search>
<row>
<panel>
<chart>
<title>Event count by log level</title>
<!-- post-process search -->
<search base="baseSearch">
<query>
stats sum(count) AS count by log_level
</query>
</search>
</chart>
</panel>
<panel>
<chart>
<title>Error count by component</title>
<!-- post-process search -->
<search base="baseSearch">
<query>
search log_level=error | stats sum(count) AS count by component
</query>
</search>
<option name="charting.chart">bar</option>
</chart>
</panel>
</row>
</dashboard>
<dashboard>
<label>Dashboard with empty post-process search</label>
<description></description>
<!-- Example uses stats transforming command -->
<!-- This limits events passed to post-process search -->
<search id="baseSearch">
<query>index=_internal source=*splunkd.log | stats count by component, log_level</query>
<earliest>-30d</earliest>
<latest>now</latest>
</search>
<row>
<panel>
<chart>
<title>Count by component, log level (from post-process search)</title>
231
<!-- post-process search -->
<search base="baseSearch">
<query>stats sum(count) AS count by log_level</query>
</search>
<option name="charting.axisY.scale">log</option>
</chart>
</panel>
<panel>
<chart>
<title>Count by component (from base search)</title>
<!-- empty post-process search -->
<search base="baseSearch" />
<option name="charting.chart">bar</option>
</chart>
</panel>
</row>
</dashboard>
Drilldown elements
drilldown
Define custom destinations to link to when a user clicks on fields in a dashboard or form.
Note: You can specify one or more actions (<link>, <set>, <unset>) or conditions (<condition>) directly within
<drilldown>, but you cannot specify both actions and conditions.
Attributes
232
Name Type Default Description
Specify an arbitrary string to open the drilldown in a new window. Subsequent references to this
target open in this window.
Parent elements
<drilldown>
( <link> | <set> | <unset> ) (1..n) | <condition> (1..n)
<table>
<search>index=_internal</search>
<table>
<search>index=_internal</search>
<chart>
<search>
index=_internal | chart count by sourcetype
</search>
<option name="charting.chart">column</option>
233
</chart>
condition (drilldown)
Limits the scope of drilldown actions to clicks on specific fields. If the <condition> element is not present, then drilldown
actions apply to all fields.
Note: The <condition> element applies to both input elements and drilldown elements. See <condition> (input) for
details.
Parent element
<drilldown>
<condition>
(<link> | <set> | <unset>) (1..n)
Attributes
Input context only. Specifies the input <label> element to which the condition applies.
label text *
'*' applies the condition to all input <label> elements. See <condition> (input).
Input context only. Specifies the input <value> element to which the condition applies.
value text *
'*' applies the condition to all input <value> elements. See <condition> (input).
Example
See the example for <set> for using the <condition> tag to set a token for in-page drilldown.
See the example for <unset> for using multiple <condition> tags.
selection
Sets the time window for the pan and zoom feature of charts. You can also use tokens to set other values, such as the
numerical values of the x-axis in a chart.
See Chart controls for details on the pan and zoom feature of charts.
Parent elements
<chart>
<option name="charting.chart">area</option>
| <option name="charting.chart">column</option>
| <option name="charting.chart">line</option>
234
Use pre-defined tokens to capture the earliest and latest time of the time window and the earliest and latest values within
that time window for a field.
For example:
<selection>
<set token="selection.earliest">$start$</set>
<set token="selection.latest">$end$</set>
<set token="start.[fieldname]">$start.[fieldname]$</set>
<set token="end.[fieldname]">$end.[fieldname]$</set>
</selection>
<selection>
<link>
Attributes
Example
A selection on the left chart zooms into the right chart with details for the selected area.
<dashboard>
<label>Pan and Zoom</label>
<row>
<panel>
<chart>
<title>Pan and Zoom (All source types)</title>
<search>
<query>
index=_internal | timechart count by sourcetype
</query>
<earliest>-7d@h</earliest>
<latest>now</latest>
</search>
<option name="charting.axisX.scale">linear</option>
<option name="charting.axisY.scale">log</option>
<option name="charting.chart">line</option>
<selection>
<set token="selection.earliest">$start$</set>
<set token="selection.latest">$end$</set>
<set token="start.splunk_web_access">$start.splunk_web_access$</set>
<set token="end.splunk_web_access">$end.splunk_web_access$</set>
</selection>
<option name="charting.axisTitleX.text">Last 7 Days</option>
</chart>
</panel>
<panel>
<chart>
<title>Pan and Zoom (Web access source type)</title>
<search>
<query>
index=_internal sourcetype=splunk_web_access
235
| timechart count by sourcetype
</query>
<earliest>$selection.earliest$</earliest>
<latest>$selection.latest$</latest>
</search>
<option name="charting.chart">column</option>
<option name="charting.legend.placement">none</option>
<option name="charting.legend.masterLegend">null</option>
<option name="charting.axisX.scale">linear</option>
<option name="charting.axisY.scale">log</option>
<option name="charting.axisTitleX.text">Selected Time Range</option>
</chart>
</panel>
</row>
<row>
<panel>
<html>
<h3>Token values for the splunk_web_access selection</h3>
<table border="0" cellpadding="12" cellspacing="0">
<tr>
<td>
<p><b>Time range (epoch time)</b></p>
<p>
<b>$$selection.earliest$$</b>: $selection.earliest$<br/>
<b>$$selection.latest$$</b>: $selection.latest$
</p>
</td>
<td>
<p><b>Count at the begining and end of time range.</b></p>
<p>
<b>$$start.splunk_web_access$$</b>: $start.splunk_web_access$<br/>
<b>$$end.splunk_web_access$$</b>: $end.splunk_web_access$</p>
</td>
</tr>
</table>
</html>
</panel>
</row>
</dashboard>
236
Drilldown event tokens
For dynamic drilldown, these are the event tokens, and their values, that are available for each type of visualization.
The clicked field name is the name of the field or series for the y-Axis if present (similar to click.name2). If the name of the
field or series is not available the field or category for the x-axis is used (click.name).
click.value Value of the field or category for the x-axis. Not available when the legend has been clicked.
click.value2 Value of the field or series for the y-axis. Not available when the legend has been clicked.
Any field values along the y-axis at the same point as the click on the x-axis. Not available when the legend has been
row.<fieldname>
clicked.
row.<x-axis-name> Value of the x-axis. Not available when the legend has been clicked.
earliest/latest Time range of the clicked chart segment, or if not applicable, the time range of the search.
The value for click.name depends on the context of the click, as described below:
For cases in the event viewer where the field name is ambiguous:
click.name • Click a term in the raw event: Sets _raw as the field name.
• Click the event timestamp: Sets _time as the field name.
• Click a tag: Sets a field name according to the tag name, as follows:
tag::<field>
(for example, when host is tagged, tag::host)
237
Data Property Description
earliest: _time
latest: (_time + 1 second)
The field for the <condition> tag in dynamic drilldown always corresponds to click.name.
click.value Value of the first, or only field, that displays the marker.
click.lat.name For cluster maps: latitude field name for the clicked location.
click.lat.value For cluster maps: latitude field value for the clicked location.
click.lon.name For cluster maps: longitude field name for the clicked location.
click.lon.value For cluster maps: longitude field value for the clicked location.
For cluster maps: south, west, north, or east outer boundary for the clicked location. For example, use
click.bounds.<orientation>
$click.bounds.east$ to get the eastern outer boundary.
row.<fieldname> Each field value of the clicked marker is exposed in this form.
The field for the <condition> tag in dynamic drilldown always corresponds to click.name.
row.<fieldname> Exposes each field in the same result row from which the single value is taken.
earliest/latest Time range of the search driving the single value visualization.
table (event tokens)
The field for the <condition> tag in dynamic drilldown always corresponds to click.name2.
238
Data Property Description
row.<fieldname> All field values for the clicked table row, including those fields that are not displayed.
earliest/latest Time range of the clicked table row, or if not applicable, the time range of the search.
Set or update token values to create dynamic content or behavior changes. See also Token usage in dashboards to learn
about using the <init> element to set tokens on page load.
eval
Add custom logic to a dashboard. See Custom logic for dashboard eval expressions for more information.
Parent elements
<drilldown>
<eval token="[token_name]">
<drilldown>
<condition>
<eval token="[token_name]">
<change>
<eval token="[token_name]">
<change>
<condition>
<eval token="[token_name]">
<search>
<condition>
<eval token="[token_name]">
<search>
<eval token="[token_name]">
Attributes
239
<dashboard stylesheet="eval_tokens.css">
<label>Eval Tokens</label>
<row>
<panel>
<title></title>
<search id="search_logic">
<query>index=_internal | top sourcetype</query>
<earliest>0</earliest>
<latest>now</latest>
<progress>
<eval token="duration">tostring(tonumber($job.runDuration$),"duration")</eval>
</progress>
</search>
<chart>
<title>Top sourcetypes for index=_internal</title>
<search base="search_logic" />
<option name="charting.chart">bar</option>
</chart>
<html>
<h3>Duration</h3>
<div class="custom-result-value">$duration$</div>
</html>
</panel>
</row>
</dashboard>
link
Use <link> as a child tag of <condition> when you want to configure distinct drilldown actions for specific fields or inputs.
Otherwise, use <link> as a child tag of <change> or <drilldown>.
There are various ways to specify a destination for the drilldown using relative paths or a URL, as described below.
Parent elements
240
<drilldown>
<link>
<drilldown>
<condition>
<link>
<change>
<link>
<change>
<condition>
<link>
<search>
<condition>
<link>
<search>
<link>
Attributes
(<drilldown> only) Specifies which values to capture in a table from the specified column or
Field
field row. Cannot be specified together with the series attribute.
name
Although the field attribute is supported, Splunk recommends that you specify fields with the
<condition> tag.
Deprecated. Use <condition field="[field]"...>
(<drilldown> only) Specifies which values to capture in a chart from the specified series.
Series
series Cannot be specified together with the field attribute.
name
Although the series attribute is supported, Splunk recommends that you specify series with
the <condition> tag.
Corresponds to the target attribute of the <a> HTTP tag. Specifying target for the <link> element overrides
the value of target specified in the <drilldown> element.
Specify an arbitrary string to open the drilldown in a new window. Subsequent references to
this target open in this window.
Parent element
<drilldown><condition>
241
2) <link> [path/viewname] </link>
3) <link> [path/viewname?form.token=$dest_value$] </link>
4) <link> [path/viewname?form.token=$dest_value$&earliest=$earliest$&latest=$latest$] </link>
5) <link> [URL?q=$dest_value$] </link>
1. Use the specified view, which must be in the same path as the current dashboard.
2. Relative path to connect to a dashboard.
3. Relative path to connect to a form, passing in a token to populate the form.
4. Pass in the earliest and latest time range from the original search.
(Requires use of CDATA to escape special characters.)
5. URL and query argument to pass a value to the destination page.
path
However, you can also specify a relative path, based on the app context of the source and destination
views.
viewname The name of the Splunk view you are using for a destination.
$dest_value$ Specifies how to capture a value from a visualization. See Drilldown event tokens for details on each visualizaion.
URL Specify a URL to a web page. Use the full address, including the protocol. For example: http://.
q When specifying a URL, use q to specify the value of dest_value in a query string to a web resource.
Example
<form>
. . .
<fieldset>
<input type="dropdown" token="openNewPageToken">
<label></label>
<default>Select a page to open</default>
<choice value="">Select a page to open</choice>
<choice value="manager_page">View prebuilt panels</choice>
<choice value="splk_page">Open Splunk home page</choice>
<change>
<condition value="manager_page">
<link target="_blank">
/manager/search/data/ui/panels?ns=-&pwnr=-&search=&count=25
</link>
</condition>
<condition value="splk_page">
<link target="_blank">
http://splunk.com
</link>
</condition>
</change>
</input>
</fieldset>
. . .
</form>
242
set
Allows you to publish new global tokens that can be consumed by any other element or search within the dashboard. You
typically publish tokens when using form inputs or when using drilldown.
For form inputs, specify tokens for actions to take for specific inputs.
For drilldown, specify the value to capture when clicked. The value can be set dynamically using a token.
For form inputs, <set> can be a child tag of <change> or <condition>. For drilldown, <set> can be a child tag of
<drilldown> or <condition>.
Use <set> as a child tag of <condition> when you want to configure distinct actions for specific inputs or for fields for
drilldown. Otherwise, use <set> as a child tag of <change> or <drilldown> to specify an action for all inputs or for all fields.
Parent elements
1. Use a template to combine input tokens and static portions to form the new token value. Templates let you reference
multiple tokens when setting the value, and also specify quotes for the value using the |s token filter.
2. Use the prefix and suffix attributes to specify static portions for the input token. The following is equivalent to the
template example above.
Attributes
243
Name Type Default Description
prefix text String to place before the value of the token.
A click on the table sets a token which is consumed by the search of the chart visualization.
<dashboard>
<label>In-page Drilldown</label>
<row>
<panel>
<table>
<title>Set sourcetype token on click</title>
<search>
<query>
index=_internal | stats count by sourcetype
</query>
<earliest>-1h</earliest>
<latest>now</latest>
</search>
<drilldown>
<condition field="sourcetype">
<set token="sourcetype">$click.value2$</set>
</condition>
</drilldown>
</table>
<chart>
<title>Chart for $sourcetype$</title>
<search>
<query>
index=_internal sourcetype=$sourcetype$ | timechart count by sourcetype
</query>
<earliest>-1h</earliest>
<latest>now</latest>
</search>
</chart>
</panel>
</row>
</dashboard>
unset
Parent element
<change> <condition>
<drilldown> <condition>
<change>
<drilldown>
244
Attributes
<dashboard>
<label>Example for <set> and <unset></label>
<row>
<panel>
<table>
<title>Set sourcetype token</title>
<search>
<query>
index=_internal | stats count by sourcetype
</query>
<earliest>-1h</earliest>
<latest>now</latest>
</search>
<drilldown>
<!-- For the sourcetype field clicked: -->
<!-- Set token to display a chart -->
<!-- Unset token to display a table -->
<condition field="sourcetype">
<set token="sourcetype">$row.sourcetype$</set>
<set token="showChart">foo</set>
<unset token="showTable"></unset>
</condition>
<!-- For any other field clicked: -->
<!-- Set token to display a table -->
<!-- Unset token to display a chart -->
<condition field="*">
<set token="sourcetype">$row.sourcetype$</set>
<set token="showTable">foo</set>
<unset token="showChart"></unset>
</condition>
</drilldown>
</table>
</panel>
<!-- Hide the html panel when either token is present -->
<!-- Click in the original table to set either token -->
<panel>
<html rejects="$showTable$, $showChart$">
<h2>Details</h2>
<div style="padding: 50px; margin: 0 auto; width: 350px;">
<div class="alert alert-warning">
<i class="icon-alert"/>
Click on a row in the table on the left to show details.
</div>
</div>
</html>
<!-- if showChart token is set, display results here -->
<chart depends="$showChart$">
245
<title>Details for $submitted:sourcetype|s$</title>
<search>
<query>
index=_internal sourcetype=$sourcetype|s$
| timechart count by sourcetype
</query>
<earliest>-1h</earliest>
<latest>now</latest>
</search>
</chart>
<!-- if showCTable token is set, display results here -->
<table depends="$showTable$">
<title>Details for $submitted:sourcetype|s$</title>
<search>
<query>
index=_internal sourcetype=$sourcetype|s$
| timechart bins=10 count by sourcetype
</query>
<earliest>-1h</earliest>
<latest>now</latest>
</search>
<option name="wrap">true</option>
<option name="rowNumbers">false</option>
<option name="dataOverlayMode">none</option>
<option name="drilldown">cell</option>
<option name="count">10</option>
</table>
</panel>
</row>
</dashboard>
Deprecations and removals
Check the Deprecated features list in the Release Notes for information on deprecated or removed elements.
<chart>
A panel that displays search data in a chart. Saved reports contain chart formatting parameters. Saved searches do not.
For more information, see "Save reports and share them with others."
When you load a saved report in the chart panel, your saved report format is also loaded. However, chart formatting can
be overridden inline using the chart options.
Charts use named options to specify chart-specific properties. This reference contains sections on all configurable
properties of charts.
Parent elements
<row>
<panel>
246
<chart>
<chart>
<title> (0..1)
<search> (0..1)
<earliest> (0..1)
<latest> (0..1)
<drilldown> (0..n)
<selection> (0..n, for charts of type area, line, and column only)
<option name="[property]"> (0..n)
charting.data.fieldShowList array of fields — The list of fields to explicitly show in the results.
charting.data.fieldHideList array of fields — The list of fields to explicitly hide from the results.
Example:
247
Property Type Default Description
[]{}(),:"
charting.legend.labels CSV of labels — A list of labels with which to pre-populate the legend.
charting.legend.masterLegend n/a
Note: The only valid value is an empty tag.
If a value is specified, the attribute is
ignored.
Use an array of hexadecimal values to define the
colors of chart series.
height Number —
Default value is 250, must be between 100
and 10000.
*Default value for charting.seriesColors:
248
General Chart Properties: selected examples
<dashboard>
<label>Selected chart examples</label>
<row>
<panel>
<chart>
<title>A line chart</title>
<search>
<query>
index=_internal source="*metrics.log"
group=per_sourcetype_thruput
| timechart sum(kb) by series
</query>
<earliest>-1h</earliest>
<latest>now</latest>
</search>
<option name="charting.chart">line</option>
</chart>
</panel>
<panel>
<chart>
<title>Show only splunkd_access and splunkd fields</title>
<search>
<query>
index=_internal source="*metrics.log"
group=per_sourcetype_thruput
| timechart sum(kb) by series
</query>
<earliest>-1h</earliest>
<latest>now</latest>
</search>
<option name="charting.data.fieldShowList">
["splunkd_access", "splunkd"]
</option>
<option name="charting.chart">line</option>
</chart>
</panel>
</row>
<row>
<panel>
<chart>
<title>Show all fields except splunk_web_service, splunkd_access, and splunkd</title>
<search>
<query>
index=_internal source="*metrics.log"
group=per_sourcetype_thruput
| timechart sum(kb) by series
</query>
<earliest>-1h</earliest>
<latest>now</latest>
</search>
<option name="charting.data.fieldHideList">
["splunk_web_service", "splunkd_access", "splunkd"]
</option>
<option name="charting.chart">line</option>
</chart>
249
</panel>
<panel>
<html>
Use the <tt>eval</tt> function in the search to transpose
the value of the <tt>log_level</tt> field into individual
fields for <tt>charting.fieldcolors</tt>.
</html>
<chart>
<title>Field colors example</title>
<search>
<query>
index = _internal log_level=* | stats
count(eval(log_level="ERROR")) as ERROR
count(eval(log_level="WARN")) as WARN
count(eval(log_level="INFO")) as INFO
by sourcetype
</query>
<earliest>-7d@h</earliest>
<latest>now</latest>
</search>
<option name="charting.axisY.scale">log</option>
<option name="charting.chart">column</option>
<option name="charting.fieldColors">
{"ERROR": 0xFF0000, "WARN": 0xFF9900, "INFO":0x0066FF, "NULL":0xC4C4C0}
</option>
<option name="charting.legend.placement">right</option>
</chart>
</panel>
</row>
</dashboard>
250
Area, Bubble, Bar, Column, Line, and Scatter charts
Properties specific to line, area, column, scatter, bubble, and bar charts, all of which contain an x-axis and y-axis.
charting.axisLabelsX.integerUnits
Indicates whether the major unit is rounded to
charting.axisLabelsY.integerUnits Boolean false
the nearest integer.
charting.axisLabelsY2.integerUnits
(-90 | -45 | 0 | 45 | 90
charting.axisLabelsX.majorLabelStyle.rotation 0 Positive values rotate clockwise.
)
Negative values rotate
counterclockwise
charting.axisLabelsX.majorLabelVisibility (auto | show | hide) auto *Note:
charting.axisLabelsY.majorLabelVisibility charting.axisLabelsY.majorLabelVisibility
charting.axisLabelsY2.majorLabelVisibility is deprecated.
Controls the visibility of major tick mark labels.
251
Property Type Default Description
auto: Shows or hides individual major
labels to maintain readability in the
available space without overlapping
charting.axisLabelsX.minorTickSize
charting.axisLabelsY.minorTickSize Number 6 The size, in pixels of the minor tick marks.
charting.axisLabelsY2.minorTickSize
252
Property Type Default Description
show: Force all minor ticks to be
visible, regardless of label visibility
charting.axisX.maximumNumber
Number auto Sets the maximum number for the axis range.
charting.axisY.maximumNumber
charting.axisX.minimumNumber
Number auto Sets the minimum number for the axis range.
charting.axisY.minimumNumber
charting.axisX.scale
(linear | log) linear Only the bubble and scatter charts
charting.axisY.scale
support a logarithmic scale for the
x-axis.
charting.axisTitleX.text
charting.axisTitleY.text Text — Specifies the title of the axis.
charting.axisTitleY2.text
253
Property Type Default Description
(top | left | bottom |
right | none)
Area chart properties
charting.axisY2.fields comma delimited list — Fields to be mapped to a second y-axis for chart overlays.
Sets the maximum number for the y-axis range for chart
charting.axisY2.maximumNumber Number auto
overlays.
charting.axisY2.minimumNumber Number auto Sets the minimum number for the y-axis range for chart overlays.
(default | stacked |
charting.chart.stackMode default Set up stacked area charts.
stacked100)
Bar chart properties
charting.chart.showDataLabels (all | minmax | none) none Indicates how to display labels in the chart:
254
Property Type Default Description
minmax: Display labels only for the lowest and highest
values.
charting.chart.bubbleSizeBy (area | diameter) area Determines whether the area or the diameter determine the bubble size.
Column chart properties
charting.axisY2.fields comma delimited list — Fields to be mapped to a second y-axis for chart overlays.
Sets the maximum number for the y-axis range for chart
charting.axisY2.maximumNumber Number auto
overlays.
Sets the minimum number for the y-axis range for chart
charting.axisY2.minimumNumber Number auto
overlays.
255
Line chart properties
256
Gauge charts
You can specify any number of colors. If the gauge has more or
less range intervals than the number of rangeColors, colors are
interpolated as necessary. This interpolation occurs regardless
of whether you specify the range interval in the search language
or the rangeValues parameter.
charting.chart.majorUnit Number auto Specifies, in pixels, the spacing of major tick marks.
[0,30,70,100]
array of indicates that the gauge starts at zero, ends at 100, and has
charting.chart.rangeValues —
number three subranges that are each identified by another filler color. If
the search returns a value of 71, the filler rises to that value on
the gauge and takes on the color assigned to the top range,
which is 71-100.
257
Property Type Default Description
charting.chart.showMajorTicks Boolean True Indicates whether to display major tick marks.
See Indicates whether to display minor tick marks. Defaults to False for radial
charting.chart.showMinorTicks Boolean
description gauge and True for filler and marker gauges
charting.chart.showValue Boolean True Indicates whether the gauge displays its value.
charting.chart.usePercentageValue Boolean False Indicates whether to format the gauge values as percentages.
Filler gauge specific properties
charting.chart.orientation (x | y) y x: horizontal
y: vertical
Marker gauge specific properties
charting.chart.orientation (x | y) y x: horizontal
y: vertical
Indicates whether to show the color ranges as a band on the left side of the marker
charting.chart.showRangeBand boolean true
gauge.
Radial gauge specific properties
charting.chart.showRangeBand boolean true Indicates whether to show the color ranges as a band at the top of the radial gauge.
258
Pie charts
charting.chart.sliceCollapsingThreshold Number 0.01 0 indicates no collapsing. 1 indicates all slices collapse into a
single pie.
charting.chart.showPercent Boolean false Indicates whether to display percentage values with the labels.
• <checkbox>
• <dropdown>
• <link>
• <multiselect>
• <radio>
• <text>
• <time>
Form input event handlers use predefined tokens to access the label and value of the selected <choice> element of an
input.
Token Description
259
label Access the label of the selected <choice> element of an input.
<change>
Lets you set tokens based on a selected choice for a form input. Use with the <condition> element to define conditional
actions based on a selected choice.
<input type="checkbox">
<input type="dropdown">
<input type="link">
<input type="radio">
<input type="text">
<input type="time">
<change>
<condition [label="foo" | value="foo" | match="(dashboard eval expression)"]>(0..n)
(<eval> | <link> | <set> | <unset>) (1..n)
Attributes
Use the <change> element to capture the selected label and value from an input.
<form>
<label>Use tokens with input choices to capture input labels and values</label>
<fieldset submitButton="false">
<input type="radio" token="period_tok">
<label>Select a time range</label>
<choice value="-24h@h">Last 24 Hours</choice>
<choice value="-7d@d">Last 7 Days</choice>
<choice value="-30d@d">Last 30 Days</choice>
<default>Last 24 Hours</default>
<change>
<!-- use predefined input tokens to set -->
<!-- tokens for the selected label and value -->
<set token="date_label">$label$</set>
<set token="earliest_tok">$value$</set>
</change>
</input>
</fieldset>
<row>
<panel>
<title>Conditional Inputs</title>
260
<change>
<chart>
<!-- Display selected label in the title -->
<title>Source Type by $date_label$</title>
<search>
<query>index = _internal | timechart count by sourcetype</query>
<!-- use the value of earliest_tok -->
<!-- to set the time range -->
<earliest>$earliest_tok$</earliest>
<latest>now</latest>
</search>
<option name="charting.axisY.scale">log</option>
<option name="charting.axisTitleX.text">Time period</option>
<option name="charting.axisTitleY.text">Events</option>
</chart>
</panel>
</row>
</form>
Search event handlers allow you to enable event actions based on search results or search properties. Actions include
linking to a page, setting or unsetting tokens, and executing an eval function.
Search event handlers use predefined tokens to access the search results and search properties. The tokens available to
each handler vary. In some cases, the event handler does not access a predefined token to enable an action.
Token Description
job.property Access the value of the named job property or one of its secondary properties. For example, use
$job.request.earliest_time$ and $job.request.latest_time$ to access information about the search
time range.
261
Token Description
You can also view properties for a search from the Search Job Inspector. From the Search Page, after
running a search select Job > Inspect Job.
See View search job properties in the Search Manual for a list of properties available.
result.field Access the value of the named field. The token accesses the value from the first row of returned results.
cancelled
<cancelled>
Execute actions when a search is cancelled.
Parent element
<search>
<cancelled>
<condition match="(dashboard eval expression)">(0..n)
(<eval> | <link> | <set> | <unset>) (1..n)
Tokens available
<cancelled>
<unset token="sourcetype_count" />
</cancelled>
error
<error>
Execute actions when there is a search error event, such as an invalid query.
Parent element
<search>
<error>
<condition match="(dashboard eval expression)">(0..n)
(<eval> | <link> | <set> | <unset>) (1..n)
262
<error>
Tokens available
<search>
<error>
<set token="error_message">$message$</set>
</error>
</search>
fail
<fail>
Execute an action when a search fails while running.
Parent element
<search>
<fail>
<condition match="(dashboard eval expression)">(0..n)
(<eval> | <link> | <set> | <unset>) (1..n)
Tokens available
Example
<search>
<fail>
<set token="fail_message">$message$</set>
</fail>
</search>
progress
<progress>
Execute an action on search progress events. Access job properties and the first results row.
Parent element
<search>
<progress>
<condition match="(dashboard eval expression)">(0..n)
(<eval> | <link> | <set> | <unset>) (1..n)
Tokens available
job.property
result.field
263
<progress>
Example
<progress>
<condition match=" 'job.resultCount' == 0">
<set token="show_html">true</set>
</condition>
<condition>
<unset token="show_html"/>
</condition>
<progress>
done
<done>
Execute actions based on finished search events.
Parent element
<search>
<done>
<condition match="(dashboard eval expression)">(0..n)
(<eval> | <link> | <set> | <unset>) (1..n)
Tokens available
job.property
result.field
Example
<done>
<condition match=" 'job.resultCount' == 0">
<set token="show_html">true</set>
</condition>
<condition>
<unset token="show_html"/>
</condition>
</done>
<[Visualization]>
Event handlers apply to the following visualization types:
• chart
• event
• map
• single
• table
<[Visualization]>
<drilldown> (0..n)
<condition [label="foo" | value="foo" | match=(dashboard eval expression)]>(0..n)
(<eval> | <link> | <set> | <unset>) (1..n)
<selection> (0..n, for charts of type area, line, and column only)
264
<[Visualization]>
(<eval> | <link> | <set> | <unset>) (1..n)
Child elements
element Type Default Description
Event
<drilldown> — Actions to take for drilldown behavior.
actions
<selection> <set> —
Use the <set> element to define tokens for the time window used in the pan and
zoom feature of charts.
Example
Example line chart panel using an inline search. It limits results to a specified time window and provides labels for the X
and Y axes:
<dashboard>
<label>Top source types in the last week</label>
<row>
<panel>
<title>Chart example</title>
<chart>
<title>Top sourcetypes in the last week</title>
<search>
<query>
index=_internal source="*metrics.log" group=per_sourcetype_thruput
| timechart sum(kb) by series
</query>
<earliest>-1w</earliest>
<latest>now</latest>
</search>
<option name="height">200px</option>
<option name="charting.chart">line</option>
<option name="charting.axisY.scale">log</option>
<option name="charting.chart.nullValueMode">connect</option>
</chart>
</panel>
. . .
</row>
</dashboard>
265
<[Visualization]>
For dynamic drilldown, there are predefined tokens available for each type of visualization. The value of a predefined
token can vary, depending on the visualization.
The clicked field name is the name of the field or series for the y-Axis if present (similar to click.name2). If the name of the
field or series is not available the field or category for the x-axis is used (click.name).
click.value Value of the field or category for the x-axis. Not available when the legend has been clicked.
click.value2 Value of the field or series for the y-axis. Not available when the legend has been clicked.
Any field values along the y-axis at the same point as the click on the x-axis. Not available when the legend has been
row.<fieldname>
clicked.
row.<x-axis-name> Value of the x-axis. Not available when the legend has been clicked.
earliest/latest Time range of the clicked chart segment, or if not applicable, the time range of the search.
The value for click.name depends on the context of the click, as described below:
266
Data Property Description
The field name associated with the click.
For cases in the event viewer where the field name is ambiguous:
click.name • Click a term in the raw event: Sets _raw as the field name.
• Click the event timestamp: Sets _time as the field name.
• Click a tag: Sets a field name according to the tag name, as follows:
tag::<field>
(for example, when host is tagged, tag::host)
The field for the <condition> tag in dynamic drilldown always corresponds to click.name.
click.value Value of the first, or only field, that displays the marker.
click.lat.name Name of the latitude field that determines the location of the marker.
click.lon.name Name of the longitude field that determines the location of the marker.
267
single (event tokens)
The field for the <condition> tag in dynamic drilldown always corresponds to click.name.
row.<fieldname> Exposes each field in the same result row from which the single value is taken.
earliest/latest Time range of the search driving the single value visualization.
table (event tokens)
The field for the <condition> tag in dynamic drilldown always corresponds to click.name2.
row.<fieldname> All field values for the clicked table row, including those fields that are not displayed.
earliest/latest Time range of the clicked table row, or if not applicable, the time range of the search.
drilldown
<drilldown>
Define custom destinations to link to when a user clicks on fields in a dashboard or form.
Note: You can specify one or more actions (<eval>, <link>, <set>, <unset>) or conditions (<condition>) directly within
<drilldown>, but you cannot specify both actions and conditions.
target text — Corresponds to the target attribute of the <a> HTTP tag.
268
<drilldown>
Specify an arbitrary string to open the drilldown in a new window. Subsequent references to this
target open in this window.
Parent elements
<drilldown>
( <eval> | <link> | <set> | <unset> ) (1..n) | <condition> (1..n)
269
<drilldown>
selection
<selection>
Sets the time window for the pan and zoom feature of charts. You can also use tokens to set other values, such as the numerical values of the
x-axis in a chart.
See Chart controls for details on the pan and zoom feature of charts.
Parent elements
<chart>
<option name="charting.chart">area</option>
| <option name="charting.chart">column</option>
| <option name="charting.chart">line</option>
Use pre-defined tokens to capture the earliest and latest time of the time window and the earliest and latest values within that time window for a
field.
For example:
<selection>
<set token="selection.earliest">$start$</set>
<set token="selection.latest">$end$</set>
<set token="start.[fieldname]">$start.[fieldname]$</set>
<set token="end.[fieldname]">$end.[fieldname]$</set>
</selection>
<selection>
<link>
Attributes
A selection on the left chart zooms into the right chart with details for the selected area.
<dashboard>
<label>Pan and Zoom</label>
<row>
<panel>
<chart>
<title>Pan and Zoom (All source types)</title>
<search>
<query>
index=_internal | timechart count by sourcetype
</query>
270
<selection>
<earliest>-7d@h</earliest>
<latest>now</latest>
</search>
<option name="charting.axisX.scale">linear</option>
<option name="charting.axisY.scale">log</option>
<option name="charting.chart">line</option>
<selection>
<set token="selection.earliest">$start$</set>
<set token="selection.latest">$end$</set>
<set token="start.splunk_web_access">$start.splunk_web_access$</set>
<set token="end.splunk_web_access">$end.splunk_web_access$</set>
</selection>
<option name="charting.axisTitleX.text">Last 7 Days</option>
</chart>
</panel>
<panel>
<chart>
<title>Pan and Zoom (Web access source type)</title>
<search>
<query>
index=_internal sourcetype=splunk_web_access
| timechart count by sourcetype
</query>
<earliest>$selection.earliest$</earliest>
<latest>$selection.latest$</latest>
</search>
<option name="charting.chart">column</option>
<option name="charting.legend.placement">none</option>
<option name="charting.legend.masterLegend">null</option>
<option name="charting.axisX.scale">linear</option>
<option name="charting.axisY.scale">log</option>
<option name="charting.axisTitleX.text">Selected Time Range</option>
</chart>
</panel>
</row>
<row>
<panel>
<html>
<h3>Token values for the splunk_web_access selection</h3>
<table border="0" cellpadding="12" cellspacing="0">
<tr>
<td>
<p><b>Time range (epoch time)</b></p>
<p>
<b>$$selection.earliest$$</b>: $selection.earliest$<br/>
<b>$$selection.latest$$</b>: $selection.latest$
</p>
</td>
<td>
<p><b>Count at the begining and end of time range.</b></p>
<p>
<b>$$start.splunk_web_access$$</b>: $start.splunk_web_access$<br/>
<b>$$end.splunk_web_access$$</b>: $end.splunk_web_access$</p>
</td>
</tr>
</table>
</html>
</panel>
</row>
271
<selection>
</dashboard>
Condition element
The <condition> element specifies the scope of actions based on one more conditions. The available conditions on which
to base actions differ, depending on the parent element. The attributes available to the condition element vary, depending
on the parent element.
• Condition (input)
• Condition (search)
• Condition (drilldown)
Condition (input)
<condition>
Specifies the scope of actions based on input choices. If the parent element <change> is not present, then the actions
apply to all choices. The <condition> element is not available for multiselect inputs.
Parent element
<input>
<change>
<condition>
(<eval> | <link> | <set> | <unset>) (1..n)
Attributes
Name Type Default Description
value text * Specifies the input <value> element to which the condition applies.
272
<condition>
Example
The token for the selected choice appears in the title for the chart. The conditional token for the selected value drives the
data for the chart.
<form>
<label>Use tokens with conditional input choices</label>
<fieldset submitButton="false">
<input type="radio" token="period_tok">
<label>Select a time range</label>
<choice value="-24h@h">Last 24 Hours</choice>
<choice value="-7d@h">Last 7 Days</choice>
<choice value="-30d@h">Last 30 Days</choice>
<default>Last 24 Hours</default>
<search>
<query>index = _internal | timechart count by sourcetype</query>
<!-- use the value of earliest_tok -->
<!-- to set the time range -->
<earliest>$earliest_tok$</earliest>
<latest>now</latest>
</search>
<option name="charting.axisY.scale">log</option>
273
<condition>
<option name="charting.axisTitleX.text">Time periods</option>
<option name="charting.axisTitleY.text">Events</option>
</chart>
</panel>
</row>
</form>
Condition (search)
<condition>
Specifies a condition and behavior for when the condition is met.
Parent elements
Attributes
Name Type Default Description
Example
<condition>
Limits the scope of drilldown actions to clicks on specific fields. If the <condition> element is not present, then drilldown
actions apply to all fields.
274
<condition>
Note: The <condition> element applies to both input elements and drilldown elements. See <condition> (input) for
details.
Parent element
<drilldown>
<condition>
(<eval> | <link> | <set> | <unset>) (1..n)
Attributes
Name Type Default Description
field text * Specifies the search field on which to implement the drilldown, or to set or unset a token.
Example
See the example for <set> for using the <condition> tag to set a token for in-page drilldown.
See the example for <unset> for using multiple <condition> tags.
Event actions
eval
<eval>
Executes an eval statement. An eval statement evaluates an expression and puts the results into a field. <eval> for dashboards works similarly,
with some exceptions, to the SPL eval command. For more details, see eval in the Search Reference.
Parent elements
<drilldown><condition>
<search><condition>
<change><condition>
<drilldown>
<eval token="[token_name]">
<drilldown>
<condition>
<eval token="[token_name]">
<change>
<eval token="[token_name]">
<change>
<condition>
<eval token="[token_name]">
<search>
<condition>
<eval token="[token_name]">
<search>
<eval token="[token_name]">
275
<eval>
Attributes
Name Type Default Description
Token whose value is the result of the eval expression. In an <eval> expression, you can use either $...$
delimiters or single quote delimiters for tokens. For example, both of the following options are valid.
token text
$my_token$
'my_token'
Example
<link>
Specifies a link to a destination for drilldown or for a selected input choice.
Use <link> as a child tag of <condition> when you want to configure distinct drilldown actions for specific fields or inputs.
Otherwise, use <link> as a child tag of <change> or <drilldown>.
There are various ways to specify a destination for the drilldown using relative paths or a URL, as described below
Parent elements
<drilldown><condition>
<search><condition>
<change><condition>
<drilldown>
<link>
<drilldown>
<condition>
<link>
<change>
<link>
<change>
<condition>
<link>
<search>
<condition>
<link>
<search>
<link>
276
<link>
Attributes
Name Type Default Description
(<drilldown> only) Specifies which values to capture in a table from the specified column or
Field
field row. Cannot be specified together with the series attribute.
name
Although the field attribute is supported, Splunk recommends that you specify fields with the
<condition> tag.
Deprecated. Use <condition field="[field]"...>
(<drilldown> only) Specifies which values to capture in a chart from the specified series.
Series
series Cannot be specified together with the field attribute.
name
Although the series attribute is supported, Splunk recommends that you specify series with
the <condition> tag.
Corresponds to the target attribute of the <a> HTTP tag. Specifying target for the <link> element overrides
the value of target specified in the <drilldown> element.
Specify an arbitrary string to open the drilldown in a new window. Subsequent references to
this target open in this window.
Parent element
<drilldown><condition>
1. Use the specified view, which must be in the same path as the current dashboard.
2. Relative path to connect to a dashboard.
3. Relative path to connect to a form, passing in a token to populate the form.
4. Pass in the earliest and latest time range from the original search.
(Requires use of CDATA to escape special characters.)
5. URL and query argument to pass a value to the destination page.
A path to the destination view from the current view. Typically, you specify path as: /app/app_name/
path
However, you can also specify a relative path, based on the app context of the source and destination
views.
viewname The name of the Splunk view you are using for a destination.
277
<link>
$dest_value$ Specifies how to capture a value from a visualization. See Drilldown event tokens for details on each visualizaion.
URL Specify a URL to a web page. Use the full address, including the protocol. For example: http://.
q When specifying a URL, use q to specify the value of dest_value in a query string to a web resource.
Example
<form>
. . .
<fieldset>
<input type="dropdown" token="openNewPageToken">
<label></label>
<default>Select a page to open</default>
<choice value="">Select a page to open</choice>
<choice value="manager_page">View prebuilt panels</choice>
<choice value="splk_page">Open Splunk home page</choice>
<change>
<condition value="manager_page">
<link target="_blank">
<![CDATA[/manager/search/data/ui/panels?ns=-&pwnr= -&search=&count=25]]>
</link>
</condition>
<condition value="splk_page">
<link target="_blank">
http://splunk.com
</link>
</condition>
</change>
</input>
</fieldset>
. . .
</form>
278
<link>
set
<set>
Allows you to publish new global tokens that can be consumed by any other element or search within the dashboard.
You typically publish tokens when using form inputs or when using drilldown.
For form inputs, specify tokens for actions to take for specific inputs.
For drilldown, specify the value to capture when clicked. The value can be set dynamically using a token.
Use <set> as a child tag of <condition> when you want to configure distinct actions for specific inputs or for fields for
drilldown. Otherwise, use <set> as a child tag of <change> or <drilldown> to specify an action for all inputs or for all
fields.
Parent elements
<change>
<condition>
<drilldown >
<condition>
<change>
<drilldown>
1. Use a template to combine input tokens and static portions to form the new token value. Templates let you reference
multiple tokens when setting the value, and also specify quotes for the value using the |s token filter.
279
<set>
2. Use the prefix and suffix attributes to specify static portions for the input token. The following is equivalent to the
template example above.
Attributes
Name Type Default Description
token Token name Required The name of the token to be consumed by the target visualization on the same page.
Example
A click on the table sets a token which is consumed by the search of the chart visualization.
<dashboard>
<label>In-page Drilldown</label>
<row>
<panel>
<table>
<title>Set sourcetype token on click</title>
<search>
<query>
index=_internal | stats count by sourcetype
</query>
<earliest>-1h</earliest>
<latest>now</latest>
</search>
<drilldown>
<condition field="sourcetype">
<set token="sourcetype">$click.value2$</set>
</condition>
</drilldown>
</table>
<chart>
<title>Chart for $sourcetype$</title>
<search>
<query>
index=_internal sourcetype=$sourcetype$ | timechart count by sourcetype
</query>
<earliest>-1h</earliest>
<latest>now</latest>
</search>
</chart>
</panel>
</row>
</dashboard>
unset
<unset>
Use <unset> to remove a token that was previously set.
Parent element
280
<unset>
<change>
<condition>
<drilldown>
<condition>
<change>
<drilldown>
Attributes
Name Type Default Description
token Token name Required The name of a token that was previously set, but to be ignored.
Example
<dashboard>
<label>Example for <set> and <unset></label>
<row>
<panel>
<table>
<title>Set sourcetype token</title>
<search>
<query>
index=_internal | stats count by sourcetype
</query>
<earliest>-1h</earliest>
<latest>now</latest>
</search>
<drilldown>
<!-- For the sourcetype field clicked: -->
<!-- Set token to display a chart -->
<!-- Unset token to display a table -->
<condition field="sourcetype">
<set token="sourcetype">$row.sourcetype$</set>
<set token="showChart">foo</set>
<unset token="showTable"></unset>
</condition>
<!-- For any other field clicked: -->
<!-- Set token to display a table -->
<!-- Unset token to display a chart -->
<condition field="*">
<set token="sourcetype">$row.sourcetype$</set>
<set token="showTable">foo</set>
<unset token="showChart"></unset>
</condition>
</drilldown>
</table>
</panel>
281
<unset>
<!-- Hide the html panel when either token is present -->
<!-- Click in the original table to set either token -->
<panel>
<html rejects="$showTable$, $showChart$">
<h2>Details</h2>
<div style="padding: 50px; margin: 0 auto; width: 350px;">
<div class="alert alert-warning">
<i class="icon-alert"/>
Click on a row in the table on the left to show details.
</div>
</div>
</html>
<!-- if showChart token is set, display results here -->
<chart depends="$showChart$">
<title>Details for $submitted:sourcetype|s$</title>
<search>
<query>
index=_internal sourcetype=$sourcetype|s$
| timechart count by sourcetype
</query>
<earliest>-1h</earliest>
<latest>now</latest>
</search>
</chart>
<!-- if showTable token is set, display results here -->
<table depends="$showTable$">
<title>Details for $submitted:sourcetype|s$</title>
<search>
<query>
index=_internal sourcetype=$sourcetype|s$
| timechart bins=10 count by sourcetype
</query>
<earliest>-1h</earliest>
<latest>now</latest>
</search>
<option name="wrap">true</option>
<option name="rowNumbers">false</option>
<option name="dataOverlayMode">none</option>
<option name="drilldown">cell</option>
<option name="count">10</option>
</table>
</panel>
</row>
</dashboard>
Token reference
Tokens are a type of variable that can be used to pass values in a simple XML dashboard. This reference lists the types
of tokens available for various scenarios.
282
Token Type Elements Description
See Define tokens for form inputs.
Contains the earliest and latest modifiers to capture the time range.
Time picker input <input type="time">
start and end capture the values of the X-axis of a chart for the beginning and end
of the selected area. For example, a selection in a time chart captures the starting
and ending time of the selection.
Pan and zoom
<selection> start.<field>and end.field capture the values of the Y-axis of a chart at the
event
beginning and end of the selected area. For example, a selection in a time chart
captures the number of events for the series specified by <field>.
Define tokens for pan and zoom chart controls contains an example using a time
chart.
User defined token within a condition element to configure conditional operations. Conditional
operations include:
See Define tokens for conditional operations with the <drilldown> element.
User defined token within a condition element to modify searches or select which visualization to
<input> display based on the conditional value of a token.
<change>
Conditional form
<condition>
input action See Define tokens for conditional operations with form inputs.
<link>
<set>|<unset>
Conditional operations with form inputs example
283
Token Type Elements Description
Set and unset tokens to specify a target page to open.
<input>|<drilldown>
Set destination <condition>
Can be used with the <input> element or <drilldown> element. The <condition>
action <link>
<set>|<unset> element defines the condition for the action. The <link> element consumes the
token to open the target destination.
For more information, see Modify dashboards using Simple XML on the Splunk developer portal.
284