Skip to content

Commit 68e02a1

Browse files
authored
[DOCS] Move machine learning results definitions into APIs (#50257)
1 parent a26e4d1 commit 68e02a1

File tree

9 files changed

+471
-606
lines changed

9 files changed

+471
-606
lines changed

docs/reference/ml/anomaly-detection/apis/get-bucket.asciidoc

Lines changed: 103 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -40,50 +40,133 @@ bucket.
4040
include::{docdir}/ml/ml-shared.asciidoc[tag=job-id-anomaly-detection]
4141

4242
`<timestamp>`::
43-
(Optional, string) The timestamp of a single bucket result. If you do not
44-
specify this parameter, the API returns information about all buckets.
43+
(Optional, string) The timestamp of a single bucket result. If you do not
44+
specify this parameter, the API returns information about all buckets.
4545

4646
[[ml-get-bucket-request-body]]
4747
==== {api-request-body-title}
4848

4949
`anomaly_score`::
50-
(Optional, double) Returns buckets with anomaly scores greater or equal than
51-
this value.
50+
(Optional, double) Returns buckets with anomaly scores greater or equal than
51+
this value.
5252

5353
`desc`::
54-
(Optional, boolean) If true, the buckets are sorted in descending order.
54+
(Optional, boolean) If true, the buckets are sorted in descending order.
5555

5656
`end`::
57-
(Optional, string) Returns buckets with timestamps earlier than this time.
57+
(Optional, string) Returns buckets with timestamps earlier than this time.
5858

5959
`exclude_interim`::
60-
(Optional, boolean) If true, the output excludes interim results. By default,
61-
interim results are included.
60+
(Optional, boolean)
61+
include::{docdir}/ml/ml-shared.asciidoc[tag=exclude-interim-results]
6262

6363
`expand`::
64-
(Optional, boolean) If true, the output includes anomaly records.
64+
(Optional, boolean) If true, the output includes anomaly records.
6565

6666
`page`::
67-
`from`:::
68-
(Optional, integer) Skips the specified number of buckets.
69-
`size`:::
70-
(Optional, integer) Specifies the maximum number of buckets to obtain.
67+
`page`.`from`:::
68+
(Optional, integer) Skips the specified number of buckets.
69+
`page`.`size`:::
70+
(Optional, integer) Specifies the maximum number of buckets to obtain.
7171

7272
`sort`::
73-
(Optional, string) Specifies the sort field for the requested buckets. By
74-
default, the buckets are sorted by the `timestamp` field.
73+
(Optional, string) Specifies the sort field for the requested buckets. By
74+
default, the buckets are sorted by the `timestamp` field.
7575

7676
`start`::
77-
(Optional, string) Returns buckets with timestamps after this time.
77+
(Optional, string) Returns buckets with timestamps after this time.
7878

7979
[[ml-get-bucket-results]]
8080
==== {api-response-body-title}
8181

82-
The API returns the following information:
82+
The API returns an array of bucket objects, which have the following properties:
8383

84-
`buckets`::
85-
(array) An array of bucket objects. For more information, see
86-
<<ml-results-buckets,Buckets>>.
84+
`anomaly_score`::
85+
(number) The maximum anomaly score, between 0-100, for any of the bucket
86+
influencers. This is an overall, rate-limited score for the job. All the anomaly
87+
records in the bucket contribute to this score. This value might be updated as
88+
new data is analyzed.
89+
90+
`bucket_influencers`::
91+
(array) An array of bucket influencer objects, which have the following
92+
properties:
93+
94+
`bucket_influencers`.`anomaly_score`:::
95+
(number) A normalized score between 0-100, which is calculated for each bucket
96+
influencer. This score might be updated as newer data is analyzed.
97+
98+
`bucket_influencers`.`bucket_span`:::
99+
(number) The length of the bucket in seconds. This value matches the `bucket_span`
100+
that is specified in the job.
101+
102+
`bucket_influencers`.`initial_anomaly_score`:::
103+
(number) The score between 0-100 for each bucket influencer. This score is the
104+
initial value that was calculated at the time the bucket was processed.
105+
106+
`bucket_influencers`.`influencer_field_name`:::
107+
(string) The field name of the influencer.
108+
109+
`bucket_influencers`.`influencer_field_value`:::
110+
(string) The field value of the influencer.
111+
112+
`bucket_influencers`.`is_interim`:::
113+
(boolean)
114+
include::{docdir}/ml/ml-shared.asciidoc[tag=is-interim]
115+
116+
`bucket_influencers`.`job_id`:::
117+
(string)
118+
include::{docdir}/ml/ml-shared.asciidoc[tag=job-id-anomaly-detection]
119+
120+
`bucket_influencers`.`probability`:::
121+
(number) The probability that the bucket has this behavior, in the range 0 to 1.
122+
This value can be held to a high precision of over 300 decimal places, so the
123+
`anomaly_score` is provided as a human-readable and friendly interpretation of
124+
this.
125+
126+
`bucket_influencers`.`raw_anomaly_score`:::
127+
(number) Internal.
128+
129+
`bucket_influencers`.`result_type`:::
130+
(string) Internal. This value is always set to `bucket_influencer`.
131+
132+
`bucket_influencers`.`timestamp`:::
133+
(date) The start time of the bucket for which these results were calculated.
134+
135+
`bucket_span`::
136+
(number)
137+
include::{docdir}/ml/ml-shared.asciidoc[tag=bucket-span-results]
138+
139+
`event_count`::
140+
(number) The number of input data records processed in this bucket.
141+
142+
`initial_anomaly_score`::
143+
(number) The maximum `anomaly_score` for any of the bucket influencers. This is
144+
the initial value that was calculated at the time the bucket was processed.
145+
146+
`is_interim`::
147+
(boolean)
148+
include::{docdir}/ml/ml-shared.asciidoc[tag=is-interim]
149+
150+
`job_id`::
151+
(string)
152+
include::{docdir}/ml/ml-shared.asciidoc[tag=job-id-anomaly-detection]
153+
154+
`processing_time_ms`::
155+
(number) The amount of time, in milliseconds, that it took to analyze the
156+
bucket contents and calculate results.
157+
158+
`result_type`::
159+
(string) Internal. This value is always set to `bucket`.
160+
161+
`timestamp`::
162+
(date) The start time of the bucket. This timestamp uniquely identifies the
163+
bucket.
164+
+
165+
--
166+
NOTE: Events that occur exactly at the timestamp of the bucket are included in
167+
the results for the bucket.
168+
169+
--
87170

88171
[[ml-get-bucket-example]]
89172
==== {api-examples-title}

docs/reference/ml/anomaly-detection/apis/get-category.asciidoc

Lines changed: 44 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,15 @@ privileges. See <<security-privileges>> and
2828
[[ml-get-category-desc]]
2929
==== {api-description-title}
3030

31-
For more information about categories, see
31+
When `categorization_field_name` is specified in the job configuration, it is
32+
possible to view the definitions of the resulting categories. A category
33+
definition describes the common terms matched and contains examples of matched
34+
values.
35+
36+
The anomaly results from a categorization analysis are available as bucket,
37+
influencer, and record results. For example, the results might indicate that
38+
at 16:45 there was an unusual count of log message category 11. You can then
39+
examine the description and examples of that category. For more information, see
3240
{stack-ov}/ml-configuring-categories.html[Categorizing log messages].
3341

3442
[[ml-get-category-path-parms]]
@@ -39,34 +47,55 @@ For more information about categories, see
3947
include::{docdir}/ml/ml-shared.asciidoc[tag=job-id-anomaly-detection]
4048

4149
`<category_id>`::
42-
(Optional, long) Identifier for the category. If you do not specify this
43-
parameter, the API returns information about all categories in the
44-
{anomaly-job}.
50+
(Optional, long) Identifier for the category. If you do not specify this
51+
parameter, the API returns information about all categories in the {anomaly-job}.
4552

4653
[[ml-get-category-request-body]]
4754
==== {api-request-body-title}
4855

4956
`page`::
50-
`from`:::
51-
(Optional, integer) Skips the specified number of categories.
52-
`size`:::
53-
(Optional, integer) Specifies the maximum number of categories to obtain.
57+
`page`.`from`:::
58+
(Optional, integer) Skips the specified number of categories.
59+
`page`.`size`:::
60+
(Optional, integer) Specifies the maximum number of categories to obtain.
5461

5562
[[ml-get-category-results]]
5663
==== {api-response-body-title}
5764

58-
The API returns the following information:
65+
The API returns an array of category objects, which have the following properties:
5966

60-
`categories`::
61-
(array) An array of category objects. For more information, see
62-
<<ml-results-categories,Categories>>.
67+
`category_id`::
68+
(unsigned integer) A unique identifier for the category.
69+
70+
`examples`::
71+
(array) A list of examples of actual values that matched the category.
72+
73+
`grok_pattern`::
74+
experimental[] (string) A Grok pattern that could be used in {ls} or an ingest
75+
pipeline to extract fields from messages that match the category. This field is experimental and may be changed or removed in a future release. The Grok
76+
patterns that are found are not optimal, but are often a good starting point for
77+
manual tweaking.
78+
79+
`job_id`::
80+
(string)
81+
include::{docdir}/ml/ml-shared.asciidoc[tag=job-id-anomaly-detection]
82+
83+
`max_matching_length`::
84+
(unsigned integer) The maximum length of the fields that matched the category.
85+
The value is increased by 10% to enable matching for similar fields that have
86+
not been analyzed.
87+
88+
`regex`::
89+
(string) A regular expression that is used to search for values that match the
90+
category.
91+
92+
`terms`::
93+
(string) A space separated list of the common tokens that are matched in values
94+
of the category.
6395

6496
[[ml-get-category-example]]
6597
==== {api-examples-title}
6698

67-
The following example gets information about one category for the
68-
`esxi_log` job:
69-
7099
[source,console]
71100
--------------------------------------------------
72101
GET _ml/anomaly_detectors/esxi_log/results/categories
@@ -78,7 +107,6 @@ GET _ml/anomaly_detectors/esxi_log/results/categories
78107
--------------------------------------------------
79108
// TEST[skip:todo]
80109

81-
In this example, the API returns the following information:
82110
[source,js]
83111
----
84112
{

0 commit comments

Comments
 (0)