Skip to content

Commit 874ebcb

Browse files
authored
[DOCS] Moves ml folder from x-pack/docs to docs (#33248)
1 parent cdeadfc commit 874ebcb

40 files changed

+50
-140
lines changed

docs/build.gradle

+6
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,12 @@
1919

2020
apply plugin: 'elasticsearch.docs-test'
2121

22+
/* List of files that have snippets that require a gold or platinum licence
23+
and therefore cannot be tested yet... */
24+
buildRestTests.expectedUnconvertedCandidates = [
25+
'reference/ml/transforms.asciidoc',
26+
]
27+
2228
integTestCluster {
2329
/* Enable regexes in painless so our tests don't complain about example
2430
* snippets that use them. */

x-pack/docs/en/ml/aggregations.asciidoc renamed to docs/reference/ml/aggregations.asciidoc

+2-2
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ PUT _xpack/ml/anomaly_detectors/farequote
4141
}
4242
----------------------------------
4343
// CONSOLE
44-
// TEST[setup:farequote_data]
44+
// TEST[skip:setup:farequote_data]
4545

4646
In this example, the `airline`, `responsetime`, and `time` fields are
4747
aggregations.
@@ -90,7 +90,7 @@ PUT _xpack/ml/datafeeds/datafeed-farequote
9090
}
9191
----------------------------------
9292
// CONSOLE
93-
// TEST[setup:farequote_job]
93+
// TEST[skip:setup:farequote_job]
9494

9595
In this example, the aggregations have names that match the fields that they
9696
operate on. That is to say, the `max` aggregation is named `time` and its

x-pack/docs/en/ml/categories.asciidoc renamed to docs/reference/ml/categories.asciidoc

+3
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ PUT _xpack/ml/anomaly_detectors/it_ops_new_logs
4444
}
4545
----------------------------------
4646
//CONSOLE
47+
// TEST[skip:needs-licence]
4748
<1> The `categorization_field_name` property indicates which field will be
4849
categorized.
4950
<2> The resulting categories are used in a detector by setting `by_field_name`,
@@ -127,6 +128,7 @@ PUT _xpack/ml/anomaly_detectors/it_ops_new_logs2
127128
}
128129
----------------------------------
129130
//CONSOLE
131+
// TEST[skip:needs-licence]
130132
<1> The
131133
{ref}/analysis-pattern-replace-charfilter.html[`pattern_replace` character filter]
132134
here achieves exactly the same as the `categorization_filters` in the first
@@ -193,6 +195,7 @@ PUT _xpack/ml/anomaly_detectors/it_ops_new_logs3
193195
}
194196
----------------------------------
195197
//CONSOLE
198+
// TEST[skip:needs-licence]
196199
<1> Tokens basically consist of hyphens, digits, letters, underscores and dots.
197200
<2> By default, categorization ignores tokens that begin with a digit.
198201
<3> By default, categorization also ignores tokens that are hexadecimal numbers.

x-pack/docs/en/ml/configuring.asciidoc renamed to docs/reference/ml/configuring.asciidoc

+6-6
Original file line numberDiff line numberDiff line change
@@ -36,20 +36,20 @@ The scenarios in this section describe some best practices for generating useful
3636
* <<ml-configuring-transform>>
3737
* <<ml-configuring-detector-custom-rules>>
3838

39-
:edit_url: https://github.com/elastic/elasticsearch/edit/{branch}/x-pack/docs/en/ml/customurl.asciidoc
39+
:edit_url: https://github.com/elastic/elasticsearch/edit/{branch}/docs/reference/ml/customurl.asciidoc
4040
include::customurl.asciidoc[]
4141

42-
:edit_url: https://github.com/elastic/elasticsearch/edit/{branch}/x-pack/docs/en/ml/aggregations.asciidoc
42+
:edit_url: https://github.com/elastic/elasticsearch/edit/{branch}/docs/reference/ml/aggregations.asciidoc
4343
include::aggregations.asciidoc[]
4444

45-
:edit_url: https://github.com/elastic/elasticsearch/edit/{branch}/x-pack/docs/en/ml/categories.asciidoc
45+
:edit_url: https://github.com/elastic/elasticsearch/edit/{branch}/docs/reference/ml/categories.asciidoc
4646
include::categories.asciidoc[]
4747

48-
:edit_url: https://github.com/elastic/elasticsearch/edit/{branch}/x-pack/docs/en/ml/populations.asciidoc
48+
:edit_url: https://github.com/elastic/elasticsearch/edit/{branch}/docs/reference/ml/populations.asciidoc
4949
include::populations.asciidoc[]
5050

51-
:edit_url: https://github.com/elastic/elasticsearch/edit/{branch}/x-pack/docs/en/ml/transforms.asciidoc
51+
:edit_url: https://github.com/elastic/elasticsearch/edit/{branch}/docs/reference/ml/transforms.asciidoc
5252
include::transforms.asciidoc[]
5353

54-
:edit_url: https://github.com/elastic/elasticsearch/edit/{branch}/x-pack/docs/en/ml/detector-custom-rules.asciidoc
54+
:edit_url: https://github.com/elastic/elasticsearch/edit/{branch}/docs/reference/ml/detector-custom-rules.asciidoc
5555
include::detector-custom-rules.asciidoc[]

x-pack/docs/en/ml/customurl.asciidoc renamed to docs/reference/ml/customurl.asciidoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ POST _xpack/ml/anomaly_detectors/sample_job/_update
106106
}
107107
----------------------------------
108108
//CONSOLE
109-
//TEST[setup:sample_job]
109+
//TEST[skip:setup:sample_job]
110110

111111
When you click this custom URL in the anomalies table in {kib}, it opens up the
112112
*Discover* page and displays source data for the period one hour before and

x-pack/docs/en/ml/detector-custom-rules.asciidoc renamed to docs/reference/ml/detector-custom-rules.asciidoc

+6-1
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ PUT _xpack/ml/filters/safe_domains
3939
}
4040
----------------------------------
4141
// CONSOLE
42+
// TEST[skip:needs-licence]
4243

4344
Now, we can create our job specifying a scope that uses the `safe_domains`
4445
filter for the `highest_registered_domain` field:
@@ -70,6 +71,7 @@ PUT _xpack/ml/anomaly_detectors/dns_exfiltration_with_rule
7071
}
7172
----------------------------------
7273
// CONSOLE
74+
// TEST[skip:needs-licence]
7375

7476
As time advances and we see more data and more results, we might encounter new
7577
domains that we want to add in the filter. We can do that by using the
@@ -83,7 +85,7 @@ POST _xpack/ml/filters/safe_domains/_update
8385
}
8486
----------------------------------
8587
// CONSOLE
86-
// TEST[setup:ml_filter_safe_domains]
88+
// TEST[skip:setup:ml_filter_safe_domains]
8789

8890
Note that we can use any of the `partition_field_name`, `over_field_name`, or
8991
`by_field_name` fields in the `scope`.
@@ -123,6 +125,7 @@ PUT _xpack/ml/anomaly_detectors/scoping_multiple_fields
123125
}
124126
----------------------------------
125127
// CONSOLE
128+
// TEST[skip:needs-licence]
126129

127130
Such a detector will skip results when the values of all 3 scoped fields
128131
are included in the referenced filters.
@@ -166,6 +169,7 @@ PUT _xpack/ml/anomaly_detectors/cpu_with_rule
166169
}
167170
----------------------------------
168171
// CONSOLE
172+
// TEST[skip:needs-licence]
169173

170174
When there are multiple conditions they are combined with a logical `and`.
171175
This is useful when we want the rule to apply to a range. We simply create
@@ -205,6 +209,7 @@ PUT _xpack/ml/anomaly_detectors/rule_with_range
205209
}
206210
----------------------------------
207211
// CONSOLE
212+
// TEST[skip:needs-licence]
208213

209214
==== Custom rules in the life-cycle of a job
210215

x-pack/docs/en/ml/functions/count.asciidoc renamed to docs/reference/ml/functions/count.asciidoc

+7
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ PUT _xpack/ml/anomaly_detectors/example1
5959
}
6060
--------------------------------------------------
6161
// CONSOLE
62+
// TEST[skip:needs-licence]
6263

6364
This example is probably the simplest possible analysis. It identifies
6465
time buckets during which the overall count of events is higher or lower than
@@ -86,6 +87,7 @@ PUT _xpack/ml/anomaly_detectors/example2
8687
}
8788
--------------------------------------------------
8889
// CONSOLE
90+
// TEST[skip:needs-licence]
8991

9092
If you use this `high_count` function in a detector in your job, it
9193
models the event rate for each error code. It detects users that generate an
@@ -110,6 +112,7 @@ PUT _xpack/ml/anomaly_detectors/example3
110112
}
111113
--------------------------------------------------
112114
// CONSOLE
115+
// TEST[skip:needs-licence]
113116

114117
In this example, the function detects when the count of events for a
115118
status code is lower than usual.
@@ -136,6 +139,7 @@ PUT _xpack/ml/anomaly_detectors/example4
136139
}
137140
--------------------------------------------------
138141
// CONSOLE
142+
// TEST[skip:needs-licence]
139143

140144
If you are analyzing an aggregated `events_per_min` field, do not use a sum
141145
function (for example, `sum(events_per_min)`). Instead, use the count function
@@ -200,6 +204,7 @@ PUT _xpack/ml/anomaly_detectors/example5
200204
}
201205
--------------------------------------------------
202206
// CONSOLE
207+
// TEST[skip:needs-licence]
203208

204209
If you use this `high_non_zero_count` function in a detector in your job, it
205210
models the count of events for the `signaturename` field. It ignores any buckets
@@ -253,6 +258,7 @@ PUT _xpack/ml/anomaly_detectors/example6
253258
}
254259
--------------------------------------------------
255260
// CONSOLE
261+
// TEST[skip:needs-licence]
256262

257263
This `distinct_count` function detects when a system has an unusual number
258264
of logged in users. When you use this function in a detector in your job, it
@@ -278,6 +284,7 @@ PUT _xpack/ml/anomaly_detectors/example7
278284
}
279285
--------------------------------------------------
280286
// CONSOLE
287+
// TEST[skip:needs-licence]
281288

282289
This example detects instances of port scanning. When you use this function in a
283290
detector in your job, it models the distinct count of ports. It also detects the

x-pack/docs/en/ml/functions/geo.asciidoc renamed to docs/reference/ml/functions/geo.asciidoc

+2-1
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ PUT _xpack/ml/anomaly_detectors/example1
4747
}
4848
--------------------------------------------------
4949
// CONSOLE
50+
// TEST[skip:needs-licence]
5051

5152
If you use this `lat_long` function in a detector in your job, it
5253
detects anomalies where the geographic location of a credit card transaction is
@@ -98,6 +99,6 @@ PUT _xpack/ml/datafeeds/datafeed-test2
9899
}
99100
--------------------------------------------------
100101
// CONSOLE
101-
// TEST[setup:farequote_job]
102+
// TEST[skip:setup:farequote_job]
102103

103104
For more information, see <<ml-configuring-transform>>.
File renamed without changes.

x-pack/docs/en/ml/populations.asciidoc renamed to docs/reference/ml/populations.asciidoc

+1-4
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,11 @@ PUT _xpack/ml/anomaly_detectors/population
5151
}
5252
----------------------------------
5353
//CONSOLE
54+
// TEST[skip:needs-licence]
5455
<1> This `over_field_name` property indicates that the metrics for each user (
5556
as identified by their `username` value) are analyzed relative to other users
5657
in each bucket.
5758

58-
//TO-DO: Per sophiec20 "Perhaps add the datafeed config and add a query filter to
59-
//include only workstations as servers and printers would behave differently
60-
//from the population
61-
6259
If your data is stored in {es}, you can use the population job wizard in {kib}
6360
to create a job with these same properties. For example, the population job
6461
wizard provides the following job settings:

x-pack/docs/en/ml/stopping-ml.asciidoc renamed to docs/reference/ml/stopping-ml.asciidoc

+4-2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ request stops the `feed1` {dfeed}:
2828
POST _xpack/ml/datafeeds/datafeed-total-requests/_stop
2929
--------------------------------------------------
3030
// CONSOLE
31-
// TEST[setup:server_metrics_startdf]
31+
// TEST[skip:setup:server_metrics_startdf]
3232

3333
NOTE: You must have `manage_ml`, or `manage` cluster privileges to stop {dfeeds}.
3434
For more information, see <<security-privileges>>.
@@ -49,6 +49,7 @@ If you are upgrading your cluster, you can use the following request to stop all
4949
POST _xpack/ml/datafeeds/_all/_stop
5050
----------------------------------
5151
// CONSOLE
52+
// TEST[skip:needs-licence]
5253

5354
[float]
5455
[[closing-ml-jobs]]
@@ -67,7 +68,7 @@ example, the following request closes the `job1` job:
6768
POST _xpack/ml/anomaly_detectors/total-requests/_close
6869
--------------------------------------------------
6970
// CONSOLE
70-
// TEST[setup:server_metrics_openjob]
71+
// TEST[skip:setup:server_metrics_openjob]
7172

7273
NOTE: You must have `manage_ml`, or `manage` cluster privileges to stop {dfeeds}.
7374
For more information, see <<security-privileges>>.
@@ -86,3 +87,4 @@ all open jobs on the cluster:
8687
POST _xpack/ml/anomaly_detectors/_all/_close
8788
----------------------------------
8889
// CONSOLE
90+
// TEST[skip:needs-licence]

0 commit comments

Comments
 (0)