Visualise results
Search shows results in the view that fits the query, and you can change it. A query that lists events opens as an event list. A query that summarises events, with stats, timechart or a similar command, opens as a table and offers charts.
Role needed: Search: Read. Adding a chart to a dashboard also needs Dashboards: Set; see Save, share and export a search.
Change the view
- Run a query.
- Select the view button at the left of the results toolbar. It shows the current view, for example Event List.
- Select a view from the menu. The menu has two groups, Tabular and Visualizations. A view that does not fit the current result is greyed out.
Tabular views
| View | Shows | Available for |
|---|---|---|
| Event List | One row per event or alert, with selected fields as field = value | Queries that list events |
| Table | The rows and columns the query returns | Every query. It is the default for an aggregation. |
| Field statistics | One row per field, with how often it appears and its top values | Queries that list events |
When you run an aggregating query, a chosen Event List or Field statistics view changes to Table, because there are no single events to list. When you run a query that lists events, a chart view changes back to Event List.
Field statistics
Field statistics profiles every field in the results over the whole time range. Each row has these columns.
| Column | Meaning |
|---|---|
| Type | The field's type, inferred from its name and sample values |
| Name | The field name |
| Documents (%) | How many events have a value for the field, and what share of the matches that is |
| Distinct values | How many different values the field has |
| Distributions | A small bar chart of the five most common values. Hover over it for the values. |
| Actions | Visualize charts the field's top values |
The rows are calculated a few at a time, so a spinner shows in cells that are not ready. Select the chevron at the start of a row to see its top values with their share. Select the plus or minus beside a value to add it to the query or to exclude it; the view then returns to the Event List. Filter by field name narrows the list. Sort by selecting a column heading.
Charts
Charts need an aggregating query. Which charts are offered depends on the columns the query returns.
| View | The query must return | Notes |
|---|---|---|
| Bar Chart | One group column and one number, such as stats count() by host.hostname. Two or more number columns with one group column draw grouped or stacked bars. | For two or more numbers, Bar style switches between Grouped and Stacked. |
| Pie Chart | One group column and one number | Offered for up to eight groups. Use head 8 to limit them. |
| Time Chart | A time column and a number, with at most one group column, such as timechart span=1h count() | Chart type switches between Area and Line. |
| Single Value | A single number, such as stats count() | Show Trend adds a small trend line over the time range. |
| Gauge | A single number | Draws the number on a dial. |
| Sankey | Two or more group columns and a number | Draws flows between the groups. |
| Heat Map | Two or more group columns and a number | Draws the number as colour. |
| Treemap | One or more group columns and a number | Draws the number as area. |
| Scatter Chart | Two or more number columns | Plots one number against another. |
| World Map | An IP address field | See below. |
If the result does not fit the chart you choose, the results area reads Not available for this result and suggests the Table view. If the query does not aggregate, it reads Not available for this query and explains that charts need stats, chart, timechart, top or rare.
World Map
World Map groups the events by an IP address field and colours each country by how many events came from it. It works on a query that lists events and does not need a stats stage, as long as the results have a field whose name ends in .ip, such as source.ip or destination.ip. When there is more than one such field, Group by lets you choose. If the results have no such field, the map reads No IP field in this result. If none of the addresses resolves to a country, it reads No resolvable countries in this result.
Chart one field quickly
Open a field in the Filters panel and select Visualize. Search adds stats count() as count by <field> | sort - count | head 10 to the query and shows it as a Bar Chart. See Act on a field value.
Next steps
- Use lookups in a search: add names and owners to what you chart.
- Save, share and export a search: put a chart on a dashboard.