Skip to content

Commit 2bfadd7

Browse files
committed
docs
1 parent 1edb62c commit 2bfadd7

File tree

3 files changed

+79
-0
lines changed

3 files changed

+79
-0
lines changed
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
## `CHANGE_POINT` [esql-change_point]
2+
3+
:::{note}
4+
The `CHANGE_POINT` function requires a [platinum license](https://www.elastic.co/subscriptions).
5+
:::
6+
7+
::::{warning}
8+
This functionality is in technical preview and may be
9+
changed or removed in a future release. Elastic will work to fix any
10+
issues, but features in technical preview are not subject to the support
11+
SLA of official GA features.
12+
::::
13+
14+
15+
The `CHANGE_POINT` processing command detects spikes, dips, and change points in a metric.
16+
17+
**Syntax**
18+
19+
```esql
20+
CHANGE_POINT value [ON key] [AS type_name, pvalue_name]
21+
```
22+
23+
**Parameters**
24+
25+
`value`
26+
: The column with the metric in which you want to detect a change point.
27+
28+
`key`
29+
: The column with the key to order the values by. If not specified, `@timestamp` is used.
30+
31+
`type_name`
32+
: The name of the output column with the change point type. If not specified, `type` is used.
33+
34+
`pvalue_name`
35+
: The name of the output column with the p-value that indicates how extreme the change point is. If not specified, `pvalue` is used.
36+
37+
**Description**
38+
39+
`CHANGE_POINT` detects spikes, dips, and change points in a metric. The command adds columns to
40+
the table with the change point type and p-value, that indicates how extreme the change point is
41+
(lower values indicate greater changes).
42+
43+
The possible change point types are:
44+
* `dip`: a significant dip occurs at this change point
45+
* `distribution_change`: the overall distribution of the values has changed significantly
46+
* `spike`: a significant spike occurs at this point
47+
* `step_change`: the change indicates a statistically significant step up or down in value distribution
48+
* `trend_change`: there is an overall trend change occurring at this point
49+
50+
::::{note}
51+
There must be at least 22 values for change point detection. Fewer than 1,000 is preferred.
52+
::::
53+
54+
**Example**
55+
56+
:::{include} ../examples/change_point.csv-spec/docsStepChange.md
57+
:::

docs/reference/query-languages/esql/commands/processing-commands.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ mapped_pages:
1717
:::{include} ../_snippets/lists/processing-commands.md
1818
:::
1919

20+
:::{include} ../_snippets/commands/layout/change_point.md
21+
:::
22+
2023
:::{include} ../_snippets/commands/layout/dissect.md
2124
:::
2225

x-pack/plugin/esql/qa/testFixtures/src/main/resources/change_point.csv-spec

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1198,3 +1198,22 @@ true | 1 | null | null
11981198
true | 1 | null | null
11991199
true | 1 | null | null
12001200
;
1201+
1202+
1203+
docsStepChange
1204+
required_capability: change_point
1205+
1206+
// tag::docsStepChange[]
1207+
ROW key = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25]
1208+
| MV_EXPAND key
1209+
| EVAL value = CASE(key<13, 0, 42)
1210+
| CHANGE_POINT value ON key
1211+
| WHERE type IS NOT NULL
1212+
// end::docsStepChange[]
1213+
;
1214+
1215+
// tag::docsStepChange-result[]
1216+
key:integer | value:integer | type:keyword | pvalue:double
1217+
13 | 42 | step_change | 0.0
1218+
// tag::docsStepChange-result[]
1219+
;

0 commit comments

Comments
 (0)