Skip to content

Commit 9c470b4

Browse files
committed
docs
1 parent 1edb62c commit 9c470b4

File tree

3 files changed

+79
-0
lines changed

3 files changed

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

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,16 @@ mapped_pages:
1414

1515
{{esql}} supports these processing commands:
1616

17+
:::{note}
18+
The `CHANGE_POINT` function requires a [platinum license](https://www.elastic.co/subscriptions).
19+
:::
20+
1721
:::{include} ../_snippets/lists/processing-commands.md
1822
:::
1923

24+
:::{include} ../_snippets/commands/layout/change_point.md
25+
:::
26+
2027
:::{include} ../_snippets/commands/layout/dissect.md
2128
:::
2229

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)