Find Events Outside a Fixed Standard Deviation Range

Detect outliers using a fixed average and standard deviation with the default factor using the math:stdDevOutliers() function

Query

flowchart LR; %%{init: {"flowchart": {"defaultRenderer": "elk"}} }%% repo{{Events}} 1[/Filter/] result{{Result Set}} repo --> 1 1 --> result
flowchart LR; %%{init: {"flowchart": {"defaultRenderer": "elk"}} }%% repo{{Events}} 1[/Filter/] result{{Result Set}} repo --> 1 1 --> result
logscale
math:stdDevOutliers(value=value, average=2, standardDeviation=1)

Introduction

The math:stdDevOutliers() function can be used to identify events where a numeric field deviates from an expected average by more than a given number of standard deviations. The baseline is defined by the average and standardDeviation parameters. Events with values outside the resulting normal range are treated as outliers.

Using a fixed baseline is useful when the expected behavior of a metric is already known, for example from historical analysis, service level objectives, or vendor specifications.

In this example, the math:stdDevOutliers() function is used to find events where the system load average deviates from a fixed baseline. The baseline has an average of 2 and a standard deviation of 1. Because the default factor is used, events are considered outliers when they are more than one standard deviation from the average. This means that the normal range is [1, 3].

Example incoming data might look like this:

@timestamphostvalue
2026-03-15T09:00:00Zweb-011.8
2026-03-15T09:00:00Zweb-022.4
2026-03-15T09:00:00Zdb-013.6
2026-03-15T09:05:00Zweb-012.1
2026-03-15T09:05:00Zweb-020.7
2026-03-15T09:05:00Zdb-013.0
2026-03-15T09:10:00Zweb-011.0
2026-03-15T09:10:00Zweb-022.9
2026-03-15T09:10:00Zdb-014.2
2026-03-15T09:15:00Zweb-012.6
2026-03-15T09:15:00Zweb-021.5
2026-03-15T09:15:00Zdb-015.1
2026-03-15T09:20:00Zweb-010.4
2026-03-15T09:20:00Zweb-022.2
2026-03-15T09:20:00Zdb-012.8

Step-by-Step

  1. Starting with the source repository events.

  2. flowchart LR; %%{init: {"flowchart": {"defaultRenderer": "elk"}} }%% repo{{Events}} 1[/Filter/] result{{Result Set}} repo --> 1 1 --> result style 1 fill:#ff0000,stroke-width:4px,stroke:#000;
    flowchart LR; %%{init: {"flowchart": {"defaultRenderer": "elk"}} }%% repo{{Events}} 1[/Filter/] result{{Result Set}} repo --> 1 1 --> result style 1 fill:#ff0000,stroke-width:4px,stroke:#000;
    logscale
    math:stdDevOutliers(value=value, average=2, standardDeviation=1)

    Evaluates the numeric values in the value field against a fixed baseline. It then returns only the events whose values fall outside the normal range.

    The value parameter specifies the field containing the numeric values to evaluate, in this case the value field.

    The average parameter sets the expected average of the data to the fixed value 2.

    The standardDeviation parameter sets the expected standard deviation to the fixed value 1.

    No factor is specified, so the default factor is used. With the default factor, the normal range is the average plus or minus one standard deviation, which gives a normal range of [1, 3]. Events with a value lower than 1 or higher than 3 are returned as outliers. All other events are filtered out.

  3. Event Result set.

Summary and Results

The query is used to find events where a numeric value deviates by more than one standard deviation from a known, fixed average.

This query is useful, for example, to detect hosts with abnormal system load, to spot unusual response times or queue depths, or to monitor sensor readings against a known operating baseline. It works without having to calculate the baseline from the data first.

Sample output from the incoming example data:

hostvalue
db-013.6
web-020.7
db-014.2
db-015.1
web-010.4

Note that outliers are returned in both directions. Values above the normal range, such as 3.6, 4.2, and 5.1 on host db-01, are returned along with values below it, such as 0.7 and 0.4. The boundary values 1.0 and 3.0 are not returned, because they are not more than one standard deviation from the average. Host db-01 produces most of the outliers, which indicates a host under repeated high load rather than a single spike.

Note that a fixed baseline does not adapt to changes in the data. If the normal behavior of the metric changes over time, the average and standardDeviation values must be updated manually.

For related methods, see Find Outliers Using Literal Quartiles, which detects outliers based on literal quartiles and the interquartile range, and Find Temperature Readings Outside Fixed Tolerance Limits, which detects outliers based on fixed tolerance limits.