boxplot

Calculates the minimum, maximum, and quartile required to draw a box plot.

Syntax

boxplot EXPR [by GRP_FIELD, ...]
Required Parameter
EXPR
An expression that is subject to the statistics.
Optional Parameter
by GRP_FIELD, ...
Grouping fields in the aggregation, separated by a comma (,). This option MUST follow after the EXPR option.

Description

The output fields are as follows:

  • count: Total number of records belonging to GRP_FIELD. Without GRP_FIELD, count the total number of records.
  • GRP_FIELD: Value of group field entered in the by clause
  • iqr1: First quartile for each group. The median value of the lowest 50% based on the median value, the lowest 25% of the total data
  • iqr2: Second quartile for each group (median value). The most central value when the data is sorted in order
  • iqr3: Third quartile for each group. The median value of the highest 50% based on the median value, the highest 25% of the total data
  • max: Maximum value for each group
  • min: Minimum value for each group

Usage

  1. Five-number summary for overall CPU load.

    table sys_cpu_logs
    | eval usage = kernel + user 
    | boxplot usage
    
  2. Five-number summary for CPU load by date.

    table sys_cpu_logs
    | eval day = string(_time, "yyyy-MM-dd")
    | eval usage = kernel + user
    | boxplot usage by day