stdev()

Table of Contents

Definition

stdev returns the sample standard deviation of the table column. You can use it with the transform commands that support aggregations.

Examples

The following example returns the sample standard deviation for the price column of sales_inventory dataset. rex4j is used for extracting prices from the _raw column. eval creates a new column that contains only the year of the timestamp which is used for grouping the result.

%dpl
index=sales_inventory earliest="01/01/2017:00:00:00"
| rex4j field=_raw "price=(?<price>\d+)"
| eval year=strftime(_time, "%Y")
| stats stdev(price) by year
example of stdev() aggregation command

Further Reading