The Gauge widget displays a single number, useful for displaying the number of errors per day or the number of active connections to a system.
The Gauge widget can display any data with at least one field containing a number. It multiple rows are present in the input, the first element is used. If multiple number fields are present, the field is unspecified.
The Gauge widget is best used in conjunction with functions such as sum
, count
,
or avg
which produce a single row with a single field like _sum
.
Using the widget’s Style editor, you can configure the widget to assume different colors for different value ranges. For example, you could make the background yellow if the value is >100, and red if it is >500.
If we wanted to show the number of errors in a system, we could count them using:
loglevel = /error/i | count()
This produces a single result with a field _count
. If the Gauge widget is
selected, it will automatically select the first field it sees and use it as
the value to display.