Skip to content

Commit 36f25d8

Browse files
authored
[DOCS] Update ML tutorial for when security is not enabled
2 parents e2b14f7 + 9cd3700 commit 36f25d8

4 files changed

+67
-65
lines changed

docs/en/stack/ml/getting-started-data.asciidoc

Lines changed: 54 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -96,60 +96,59 @@ for the fields. Mappings divide the documents in the index into logical groups
9696
and specify a field's characteristics, such as the field's searchability or
9797
whether or not it's _tokenized_, or broken up into separate words.
9898

99-
The sample data includes an `upload_server-metrics.sh` script, which you can use
100-
to create the mappings and load the data set. You can download it by clicking
101-
here: https://download.elastic.co/demos/machine_learning/gettingstarted/upload_server-metrics.sh[upload_server-metrics.sh]
99+
You can use scripts to create the mappings and load the data set. Download https://download.elastic.co/demos/machine_learning/gettingstarted/upload_server_metrics.sh[upload_server_metrics.sh] to the directory where you extracted the sample data.
102100
Before you run it, however, you must edit the USERNAME and PASSWORD variables
103-
with your actual user ID and password.
101+
with your actual user ID and password. If {security} is not enabled, use the
102+
https://download.elastic.co/demos/machine_learning/gettingstarted/upload_server_metrics_noauth.sh[upload_server_metrics_noauth.sh]
103+
script instead.
104104

105-
The script runs a command similar to the following example, which sets up a
106-
mapping for the data set:
105+
The script runs a `curl` command that makes the following create index API
106+
request:
107107

108108
[source,sh]
109109
----------------------------------
110-
curl -u elastic:x-pack-test-password -X PUT -H 'Content-Type: application/json'
111-
http://localhost:9200/server-metrics -d '{
112-
"settings":{
113-
"number_of_shards":1,
114-
"number_of_replicas":0
115-
},
116-
"mappings":{
117-
"metric":{
118-
"properties":{
119-
"@timestamp":{
120-
"type":"date"
121-
},
122-
"accept":{
123-
"type":"long"
124-
},
125-
"deny":{
126-
"type":"long"
127-
},
128-
"host":{
129-
"type":"keyword"
130-
},
131-
"response":{
132-
"type":"float"
133-
},
134-
"service":{
135-
"type":"keyword"
136-
},
137-
"total":{
138-
"type":"long"
139-
}
140-
}
110+
PUT server-metrics
111+
{
112+
"settings": {
113+
"number_of_shards":1,
114+
"number_of_replicas":0
115+
},
116+
"mappings": {
117+
"metric": {
118+
"properties":{
119+
"@timestamp": {
120+
"type":"date"
121+
},
122+
"accept": {
123+
"type":"long"
124+
},
125+
"deny": {
126+
"type":"long"
127+
},
128+
"host": {
129+
"type":"keyword"
130+
},
131+
"response": {
132+
"type":"float"
133+
},
134+
"service": {
135+
"type":"keyword"
136+
},
137+
"total": {
138+
"type":"long"
139+
}
141140
}
142-
}
143-
}'
141+
}
142+
}
143+
}
144144
----------------------------------
145-
// NOTCONSOLE
145+
// CONSOLE
146146

147-
NOTE: If you run this command, you must replace `x-pack-test-password` with your
148-
actual password.
147+
To learn more about mappings and data types, see {ref}/mapping.html[Mapping].
149148

150-
You can then use the {es} `bulk` API to load the data set. The
151-
`upload_server-metrics.sh` script runs commands similar to the following
152-
example, which loads the four JSON files:
149+
You can then use the bulk API to load the sample data set. The
150+
`upload_server_metrics.sh` script runs commands similar to the following example,
151+
which loads the four JSON files:
153152

154153
[source,sh]
155154
----------------------------------
@@ -167,19 +166,21 @@ http://localhost:9200/server-metrics/_bulk --data-binary "@server-metrics_4.json
167166
----------------------------------
168167
// NOTCONSOLE
169168

170-
TIP: This will upload 200MB of data. This is split into 4 files as there is a
171-
maximum 100MB limit when using the `_bulk` API.
169+
NOTE: If you want to try running these commands, you must specify a valid user
170+
ID and password in the `-u` parameter. If {security} is not enabled, you can
171+
omit the `-u` parameter.
172172

173-
These commands might take some time to run, depending on the computing resources
174-
available.
173+
These commands upload 200MB of data and might take some time to run, depending
174+
on the computing resources available.
175175

176-
You can verify that the data was loaded successfully with the following command:
176+
You can verify that the data was loaded successfully by running the cat indices
177+
API:
177178

178179
[source,sh]
179180
----------------------------------
180-
curl 'http://localhost:9200/_cat/indices?v' -u elastic:x-pack-test-password
181+
GET _cat/indices?v
181182
----------------------------------
182-
// NOTCONSOLE
183+
// CONSOLE
183184

184185
You should see output similar to the following:
185186

@@ -192,7 +193,7 @@ green open server-metrics ... 1 0 905940 ...
192193

193194
Next, you must define an index pattern for this data set:
194195

195-
. Open {kib} in your web browser and log in. If you are running {kib}
196+
. Open {kib} in your web browser. If you are running {kib}
196197
locally, go to `http://localhost:5601/`.
197198

198199
. Click the **Management** tab, then **{kib}** > **Index Patterns**.

docs/en/stack/ml/getting-started-multi.asciidoc

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ services have unusual patterns.
3030

3131
To create a multi-metric job in {kib}:
3232

33-
. Open {kib} in your web browser and log in. If you are running {kib} locally,
33+
. Open {kib} in your web browser. If you are running {kib} locally,
3434
go to `http://localhost:5601/`.
3535

3636
. Click **Machine Learning** in the side navigation, then click **Create new job**.
@@ -102,9 +102,6 @@ do not need more than three. If you pick many influencers, the results can be
102102
overwhelming and there is a small overhead to the analysis.
103103
104104
========================
105-
//TBD: Is this something you can determine later from looking at results and
106-
//update your job with if necessary? Is it all post-processing or does it affect
107-
//the ongoing modeling?
108105
--
109106

110107
. Click **Use full server-metrics* data**. Two graphs are generated for each
@@ -126,10 +123,12 @@ When the job is created, you can choose to view the results, continue the job in
126123
real-time, and create a watch. In this tutorial, we will proceed to view the
127124
results.
128125

129-
TIP: The `create_multi_metic.sh` script creates a similar job and {dfeed} by
126+
TIP: The `create_multi_metric.sh` script creates a similar job and {dfeed} by
130127
using the {ml} APIs. You can download that script by clicking
131-
here: https://download.elastic.co/demos/machine_learning/gettingstarted/create_multi_metric.sh[create_multi_metric.sh]
132-
For API reference information, see {ref}/ml-apis.html[Machine Learning APIs].
128+
here: https://download.elastic.co/demos/machine_learning/gettingstarted/create_multi_metric.sh[create_multi_metric.sh] Before you run it, you must edit the USERNAME and PASSWORD variables
129+
with your actual user ID and password. If {security} is not enabled, use the
130+
https://download.elastic.co/demos/machine_learning/gettingstarted/create_multi_metric_noauth.sh[create_multi_metric_noauth.sh]
131+
script instead. For API reference information, see {ref}/ml-apis.html[Machine Learning APIs].
133132

134133
[[ml-gs-job2-analyze]]
135134
=== Exploring Multi-metric Job Results

docs/en/stack/ml/getting-started-single.asciidoc

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ functions) and the fields that will be analyzed.
2020

2121
To create a single metric job in {kib}:
2222

23-
. Open {kib} in your web browser and log in. If you are running {kib} locally,
23+
. Open {kib} in your web browser. If you are running {kib} locally,
2424
go to `http://localhost:5601/`.
2525

2626
. Click **Machine Learning** in the side navigation.
@@ -128,10 +128,12 @@ When the job is created, you can choose to view the results, continue the job
128128
in real-time, and create a watch. In this tutorial, we will look at how to
129129
manage jobs and {dfeeds} before we view the results.
130130

131-
TIP: The `create_single_metic.sh` script creates a similar job and {dfeed} by
131+
TIP: The `create_single_metric.sh` script creates a similar job and {dfeed} by
132132
using the {ml} APIs. You can download that script by clicking
133-
here: https://download.elastic.co/demos/machine_learning/gettingstarted/create_single_metric.sh[create_single_metric.sh]
134-
For API reference information, see {ref}/ml-apis.html[Machine Learning APIs].
133+
here: https://download.elastic.co/demos/machine_learning/gettingstarted/create_single_metric.sh[create_single_metric.sh] Before you run it, you must edit the USERNAME and PASSWORD variables
134+
with your actual user ID and password. If {security} is not enabled, use the
135+
https://download.elastic.co/demos/machine_learning/gettingstarted/create_single_metric_noauth.sh[create_single_metric_noauth.sh]
136+
script instead. For API reference information, see {ref}/ml-apis.html[Machine Learning APIs].
135137

136138
[[ml-gs-job1-manage]]
137139
=== Managing Jobs

docs/en/stack/ml/getting-started-wizards.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs.
2626

2727
To see the job creation wizards:
2828

29-
. Open {kib} in your web browser and log in. If you are running {kib} locally,
29+
. Open {kib} in your web browser. If you are running {kib} locally,
3030
go to `http://localhost:5601/`.
3131

3232
. Click **Machine Learning** in the side navigation.

0 commit comments

Comments
 (0)