
Table
Tables can help you compare and aggregate field values. Use a table to visualize patterns for one or more metrics across a data set. Start with a query to generate a table and use formatting to highlight values, add context, or create focus for the visualization.
Create a table
- Select the table visualization using the visual editor by clicking the Add Chart button (
) in the editing toolbar and either browsing through the available charts, or by using the search option.
- Select the table on your dashboard so that it's highlighted with the blue editing outline.
- (Optional) Set up a new data source by adding a query to the Search window.
- To choose an existing search, close the window and select the visualization. If the Configuration panel doesn't appear, click the Configuration button (
) to bring up the Configuration panel and click +Setup Primary Data Source to choose an existing search.
Configuration panel options
You can use the Configuration panel to configure the following table components.
Title
Give your visualization a name. This is also helpful when searching for individual visualizations in the dashboard definitions. This name is not the same as the automatically assigned unique ID.
Description
Give your visualization a description to explain what the user is viewing.
Data Configurations
Choose an existing ad hoc search or create a new one.
Position & Size
You can use your mouse to change the size of the panel, or the Position & Size section of the Configuration panel for pixel perfect sizing.
Data settings
- Check the Show Header box to show the table header.
- Check the Show Row Numbers to show the numbers of the rows on the far left.
Font
Chose the color of the fonts for the values in the header, odd, and even rows. You can choose from a set of preselected colors by clicking the color box, or enter the hex code value of the color of your choice.
Fill
Chose the color of the fill for the table background as well as in the header, odd, and even rows. You can choose from a set of preselected colors by clicking the color box, or enter the hex code value of the color of your choice.
Number Formatting
- Use the Digit Precision field to specify the number of decimal places displayed.
- Use the Unit field to specify a unit to display.
- Use the Position selector to specify the position of the unit in relation to the value.
Drilldown
Use drilldown to allow users to click the visualization to navigate to and internal or external URL.
Code
Select your visualization or its search to view and edit the source code in real-time.
There are additional options that can only be set in the source editor. For a complete list of options available, see: Table in the Object options reference.
Example
- Transforming search
This search uses thechart
transforming command.index = _internal | chart avg(bytes) over sourcetype
- Transforming search with the table command
This search generates search results with statistics columnsaction
,host
, andcount
.index = _internal | stats count by action, host
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 thehost
andcount
columns.index = _internal | stats count by action, host | table host count
Source options for tables
While some of these options can be set using the visual editor, there are additional options that can only be set in the source editor for viz.table
. These options are added to the options
field of the visualization stanza. For example, the following example shows the addition of background color using a hex code and the count property to specify the number of rows returned.
"viz_25NNIqLF": { "type": "viz.table", "options": { "backgroundColor": "#0000FF", "count": 34 }, "dataSources": { "primary": "ds_gcEN4c7Q" } }
To read more on how visualization stanzas are structured see: Elements of a visualization. Below are all of the options available.
Table options
The following options are available for tables:
Property | Type | Default | Description |
---|---|---|---|
backgroundColor | string | black | Specify the color to use for the table background using a hex code. For example: "#FFFFFF" .
|
count | number | 20 | Specify the maximum number of rows to display. |
rowNumbers | boolean | false | Specify whether to display the row numbers. |
showHeader | boolean | true | Specify whether to display the table header. |
headerBackgroundColor | string | Light mode: "#E1E6EA". Dark mode: "#212527" | Specify the table header background color using a hex code. For example: "#FFFFFF" .
|
headerTextColor | string | Light mode: "#3C444D". Dark mode: "#FFFFFF". | Specify the table header text color using a hex code. For example: "#FFFFFF" .
|
rowBackgroundColorEven | string | Specify the background color for odd table rows using a hex code. For example, "#FFFFFF" .
| |
rowBackgroundColorOdd | string | Specify the text color for odd table rows using a hex code. For example, "#FFFFFF" .
| |
rowTextColorEven | string | Specify the text color for even table rows using a hex code. For example, "#FFFFFF" .
| |
rowTextColorOdd | string | Specify the text color for odd table rows using a hex code. For example, "#00A4FD" .
| |
numberPrecision | number | 0 | Specify the number of decimal places to display. For example, to display 3 decimal places, enter a value of 3. The maximum value is 20. |
useThousandSeparators | boolean | false | Specify whether numeric values use commas as thousandths separators. |
unit | string | N/A | Specify a label to show next to the cell value. Make sure the unit text is brief. For example, you can use an abbreviation such as MB, or a symbol such as $. |
unitPosition | (before | after) | after | Specify whether you want the unit label to appear before or after the cell value. |
dataOverlayMode | (heatmap | highlow | none ) | none | Specify which type of overlay to display. Overlays only apply to numerical columns. |
Default properties
In addition to the settings in the options
field, there are two default fields that you can set. These are not options, but should be placed at the same level as the options
field.
showProgressBar
shows a progress bar as a visualization loads and is set to false
by default.
showLastUpdated
shows the last time the visualization was refreshed and is set to false
by default.
You can enable these features by adding the properties to a visualization, and changing the settings to true
.
In the following example, the visualization will override the default for showProgressBar
and show a progress bar as it loads.
"viz_tpRnLS1I": { "type": "viz.table", "showProgressBar": true, "options": { "showSparkline": false, "backgroundColor": "#ffffff" }, "title": "Does have a progress bar", "description": "Due to viz override", "dataSources": { "primary": "ds_o7IqGHcO" }
PREVIOUS Single value icon |
NEXT Add a custom icon |
This documentation applies to the following versions of Splunk® Dashboards App: 0.8.0, 0.9.0
Feedback submitted, thanks!