Skip to main content

Configure a widget

This page shows how to add a widget to a dashboard and change it in the Configuration panel. The panel sits beside the dashboard, and the widget redraws as you change it. Nothing is saved until you select Apply and close.

Role needed: Dashboards: Set to add and change widgets, Dashboards: Delete to remove one. The query runs with your own access, which needs Search: Read (and Cases: Read when the query reads Cases).

Open the panel​

  1. Open the dashboard and select Edit.
  2. To add a widget, select Add dashboard content, then Add widget. To change one, hover over it and select its pencil icon (Edit followed by the widget's name and configuration).

The panel is titled Configuration. A flask icon beside the title marks the editor as a technical preview. Drag the left edge of the panel to make it wider. The dashboard stays visible and moves aside.

At the foot of the panel, Apply and close saves the widget and is available once you have changed something and the query result fits the chart. Cancel closes the panel and discards your changes. A new widget starts with the chart type Bar and the query source=log_* | stats count() by log.level, and its title is the name of its chart type. Change the title in the widget's Settings; see Name a widget and set its time range.

Write the query​

The query editor holds the widget's ThreatVIS PPL query. Select Search to run it. The widget and Query results update. You do not write a time range in the query. The dashboard applies its time range to every widget. See ThreatVIS PPL basics.

ControlWhat it does
EditorHighlights ThreatVIS PPL and completes field and command names.
Star iconAdds the query to your starred queries.
History iconOpens Recent and Starred queries, with a search box. Each row has Run query and Copy query to clipboard. Your history is the same as the history in Search.
Question-mark icon (PPL help)Opens help on ThreatVIS PPL and offers Recommended queries: count by a field, top values of a field, events over time, and similar ready-made queries.
Magnifier iconShows the quick filter bar: choose Data sources to add to the query, and type a condition such as user.name = 'bob'.
Keyboard shortcutsLists the shortcuts, such as running the query and starting a new line.
Prettify queryLays the query out over several lines.

To start from a saved Filter Query, type $filter( and choose from the names offered. See ThreatVIS PPL basics.

If the query cannot run, the panel shows the reason. If the result does not fit the chart type, the panel says so, and Apply and close stays unavailable until the query fits or you choose another chart type.

Read the query results​

Query results is closed at first and shows the number of rows. Open it to see the rows in a table, with Open in Search to continue in Search. Expand a row to read its fields as a table or as JSON.

Choose the chart type and fields​

Under Visualization parameters, the chart type picker shows the current type. Select it to search the list. A warning dot marks a type that cannot keep the fields you have chosen, because choosing it clears them. See Dashboard widget types for each type and what it needs.

Each chart type has groups of fields, for example Horizontal axis, Vertical axis and Breakdown for Bar. A required group that is empty says Requires field, and an optional one says Optional.

ToDo this
Add a fieldSelect Add a field in the group, then choose a column of the query under Available fields. A group that needs numbers offers only number columns.
Change a fieldSelect its name to open its settings.
Move a fieldDrag it, by its name or its handle, to another position or another group that takes it. With the keyboard, focus the field and press Space or Enter, use the arrow keys to move it, then press Space or Enter to drop it or Escape to put it back. Hold Alt or Option when dropping to copy it instead.
Remove a fieldSelect the trash icon that appears when you hover over or focus the field.
Remove them allSelect Clear layer, then Clear layer again to confirm. Don't ask me again turns the confirmation off.

A field's settings panel, titled by the field's role, has the Field picker and an Appearance section. What it offers depends on the role:

  • Name to label the field.
  • Value format for a number: Default, Number, Percent, Bytes (1024), Bits (1000), Duration or Custom format, with Decimals, Suffix and Compact values where they apply.
  • For a Table column: Text alignment, Color by value (None, Cell, Badge or Text), Hide column, Summary Row for numbers, and Directly filter on click for rows.
  • Axis side, Series color, Icon decoration, Background chart and Color for the roles that draw them.
  • Color mapping, with Edit colors, to give terms their own colours, choose a palette in categorical or gradient mode, or set colour ranges for a number column.

Bar also has Stacked, Unstacked and Percentage stacking. The settings icon beside the chart type opens Settings with Use dashboard time range. Switch it off to give the widget its own time range.

Try another chart from the suggestions​

When the query returns a result, the closed Suggestions section shows other chart types that can draw it. The first card is Current visualization. Select another card to switch the widget to that type, with its fields taken from the result. The section is hidden when the query returns whole events, no rows, or a result that no other type suits.

Set the legend and style​

For the chart types that have them, the Legend and Style icons appear at the top right of the panel. Each opens a sub-panel, and Back returns to the main panel. Only the options you change are saved, and a widget keeps its earlier look until you change them.

  • Legend sets Visibility (Auto, Show or Hide), Position, Width, Label truncation and, for line and bar charts placed outside, statistics such as Average, Maximum and Last value.
  • Style depends on the type. For Bar and Line it has Appearance, Titles and text and the Left axis, Bottom axis and Right axis, with Axis title, Gridlines, Tick labels, Axis scale and Bounds. Metric has alignment, font size, the position of the value and Colors and conditions. Table has Density, the number of lines in header and body cells, Paginate table and Show row numbers. Pie, Gauge, Heat map and Treemap have the shape, labels and values that suit them.

Name a widget and set its time range​

Hover over the widget and select its gear icon (the widget's settings). The Settings panel has:

FieldWhat it does
Show title and TitleWhether the widget shows a title, and the title.
DescriptionHelp text, shown beside the title.
Show panel borderDraws a border around the widget.
Apply custom time rangeWhen on, a Time range picker appears and the widget uses it instead of the dashboard's time range.
QueryThe widget's query, for reference. You cannot change it here.

Select Apply to save or Cancel to discard.

Add a drilldown​

A drilldown makes a value in the widget a link.

  1. While editing, hover over the widget, open its menu and select Create drilldown.
  2. In Drilldowns, choose the Action: Go to dashboard, Open in Search or Go to URL.
  3. Enter a Name. For Go to dashboard, choose the destination in Choose destination dashboard, and switch Use date range from origin dashboard on to carry the time range with the link. For Go to URL, enter the address in Enter URL. Only http and https addresses are accepted. Add variable inserts {{value}} or {{field}}, the value and field you select, and Encode URL encodes them.
  4. Optionally switch Open dashboard in new tab (or Open URL in new tab) on.
  5. Select Create drilldown.

Selecting a value in the widget then offers the drilldowns in a menu, together with Open in Search.

Use the other widget actions​

The widget menu also has Duplicate, Remove and, to reuse a widget, Copy to dashboard. See View dashboards.

Next steps​