2017-06-19 21:23:58 -04:00
|
|
|
[role="xpack"]
|
2018-08-31 19:49:24 -04:00
|
|
|
[testenv="platinum"]
|
2017-04-04 18:26:39 -04:00
|
|
|
[[ml-start-datafeed]]
|
2018-12-20 13:23:28 -05:00
|
|
|
=== Start {dfeeds} API
|
2019-04-30 13:46:13 -04:00
|
|
|
|
|
|
|
[subs="attributes"]
|
2017-12-14 13:52:49 -05:00
|
|
|
++++
|
2018-12-20 13:23:28 -05:00
|
|
|
<titleabbrev>Start {dfeeds}</titleabbrev>
|
2017-12-14 13:52:49 -05:00
|
|
|
++++
|
2017-04-04 18:26:39 -04:00
|
|
|
|
2018-06-13 16:37:35 -04:00
|
|
|
Starts one or more {dfeeds}.
|
2017-04-04 18:26:39 -04:00
|
|
|
|
2019-06-27 12:42:47 -04:00
|
|
|
[[ml-start-datafeed-request]]
|
|
|
|
==== {api-request-title}
|
2017-04-04 18:26:39 -04:00
|
|
|
|
2018-12-07 15:34:11 -05:00
|
|
|
`POST _ml/datafeeds/<feed_id>/_start`
|
2017-04-04 18:26:39 -04:00
|
|
|
|
2019-06-27 16:58:42 -04:00
|
|
|
[[ml-start-datafeed-prereqs]]
|
|
|
|
==== {api-prereq-title}
|
|
|
|
|
2019-07-26 13:47:03 -04:00
|
|
|
* Before you can start a {dfeed}, the {anomaly-job} must be open. Otherwise, an
|
|
|
|
error occurs.
|
2019-06-27 16:58:42 -04:00
|
|
|
* If {es} {security-features} are enabled, you must have `manage_ml` or `manage`
|
|
|
|
cluster privileges to use this API. See
|
2019-10-07 18:23:19 -04:00
|
|
|
<<security-privileges>>.
|
2019-06-27 16:58:42 -04:00
|
|
|
|
2019-06-27 12:42:47 -04:00
|
|
|
[[ml-start-datafeed-desc]]
|
|
|
|
==== {api-description-title}
|
2017-04-04 18:26:39 -04:00
|
|
|
|
2019-07-12 11:26:31 -04:00
|
|
|
A {dfeed} must be started in order to retrieve data from {es}.
|
|
|
|
A {dfeed} can be started and stopped multiple times throughout its lifecycle.
|
2017-04-11 21:52:47 -04:00
|
|
|
|
2017-05-02 15:45:42 -04:00
|
|
|
When you start a {dfeed}, you can specify a start time. This enables you to
|
2017-04-10 11:59:27 -04:00
|
|
|
include a training period, providing you have this data available in {es}.
|
|
|
|
If you want to analyze from the beginning of a dataset, you can specify any date
|
|
|
|
earlier than that beginning date.
|
2017-04-04 18:26:39 -04:00
|
|
|
|
2017-05-02 15:45:42 -04:00
|
|
|
If you do not specify a start time and the {dfeed} is associated with a new
|
2019-07-26 13:47:03 -04:00
|
|
|
{anomaly-job}, the analysis starts from the earliest time for which data is
|
|
|
|
available.
|
2017-04-10 11:59:27 -04:00
|
|
|
|
2017-05-02 15:45:42 -04:00
|
|
|
When you start a {dfeed}, you can also specify an end time. If you do so, the
|
2017-04-10 11:59:27 -04:00
|
|
|
job analyzes data from the start time until the end time, at which point the
|
|
|
|
analysis stops. This scenario is useful for a one-off batch analysis. If you
|
2017-05-02 15:45:42 -04:00
|
|
|
do not specify an end time, the {dfeed} runs continuously.
|
2017-04-10 11:59:27 -04:00
|
|
|
|
2017-04-11 21:52:47 -04:00
|
|
|
The `start` and `end` times can be specified by using one of the
|
|
|
|
following formats: +
|
|
|
|
|
|
|
|
- ISO 8601 format with milliseconds, for example `2017-01-22T06:00:00.000Z`
|
|
|
|
- ISO 8601 format without milliseconds, for example `2017-01-22T06:00:00+00:00`
|
|
|
|
- Seconds from the Epoch, for example `1390370400`
|
|
|
|
|
|
|
|
Date-time arguments using either of the ISO 8601 formats must have a time zone
|
|
|
|
designator, where Z is accepted as an abbreviation for UTC time.
|
|
|
|
|
|
|
|
NOTE: When a URL is expected (for example, in browsers), the `+` used in time
|
|
|
|
zone designators must be encoded as `%2B`.
|
|
|
|
|
2017-05-02 15:45:42 -04:00
|
|
|
If the system restarts, any jobs that had {dfeeds} running are also restarted.
|
2017-04-10 11:59:27 -04:00
|
|
|
|
2017-05-02 15:45:42 -04:00
|
|
|
When a stopped {dfeed} is restarted, it continues processing input data from
|
2017-05-03 11:38:31 -04:00
|
|
|
the next millisecond after it was stopped. If new data was indexed for that
|
2017-05-03 12:07:44 -04:00
|
|
|
exact millisecond between stopping and starting, it will be ignored.
|
2017-04-10 11:59:27 -04:00
|
|
|
If you specify a `start` value that is earlier than the timestamp of the latest
|
2017-05-03 11:38:31 -04:00
|
|
|
processed record, the {dfeed} continues from 1 millisecond after the timestamp
|
|
|
|
of the latest processed record.
|
2017-04-10 11:59:27 -04:00
|
|
|
|
2019-06-27 16:58:42 -04:00
|
|
|
IMPORTANT: When {es} {security-features} are enabled, your {dfeed} remembers
|
|
|
|
which roles the last user to create or update it had at the time of
|
|
|
|
creation/update and runs the query using those same roles.
|
|
|
|
|
2019-06-27 12:42:47 -04:00
|
|
|
[[ml-start-datafeed-path-parms]]
|
|
|
|
==== {api-path-parms-title}
|
2017-04-04 18:26:39 -04:00
|
|
|
|
2019-07-12 11:26:31 -04:00
|
|
|
`<feed_id>`::
|
2019-12-30 12:35:16 -05:00
|
|
|
(Required, string)
|
|
|
|
include::{docdir}/ml/ml-shared.asciidoc[tag=datafeed-id]
|
2017-04-10 11:59:27 -04:00
|
|
|
|
2019-06-27 12:42:47 -04:00
|
|
|
[[ml-start-datafeed-request-body]]
|
|
|
|
==== {api-request-body-title}
|
2017-04-04 18:26:39 -04:00
|
|
|
|
2019-07-12 11:26:31 -04:00
|
|
|
`end`::
|
|
|
|
(Optional, string) The time that the {dfeed} should end. This value is
|
|
|
|
exclusive. The default value is an empty string.
|
2017-04-04 18:26:39 -04:00
|
|
|
|
2019-07-12 11:26:31 -04:00
|
|
|
`start`::
|
|
|
|
(Optional, string) The time that the {dfeed} should begin. This value is
|
|
|
|
inclusive. The default value is an empty string.
|
2017-04-04 18:26:39 -04:00
|
|
|
|
2019-07-12 11:26:31 -04:00
|
|
|
`timeout`::
|
|
|
|
(Optional, time) Controls the amount of time to wait until a {dfeed} starts.
|
2017-04-10 11:59:27 -04:00
|
|
|
The default value is 20 seconds.
|
|
|
|
|
2019-06-27 12:42:47 -04:00
|
|
|
[[ml-start-datafeed-example]]
|
|
|
|
==== {api-examples-title}
|
2017-04-04 18:26:39 -04:00
|
|
|
|
2019-09-06 11:31:13 -04:00
|
|
|
[source,console]
|
2017-04-04 18:26:39 -04:00
|
|
|
--------------------------------------------------
|
2018-12-07 15:34:11 -05:00
|
|
|
POST _ml/datafeeds/datafeed-total-requests/_start
|
2017-04-04 18:26:39 -04:00
|
|
|
{
|
2017-04-10 11:59:27 -04:00
|
|
|
"start": "2017-04-07T18:22:16Z"
|
2017-04-04 18:26:39 -04:00
|
|
|
}
|
|
|
|
--------------------------------------------------
|
2018-08-31 19:49:24 -04:00
|
|
|
// TEST[skip:setup:server_metrics_openjob]
|
2017-04-04 18:26:39 -04:00
|
|
|
|
2017-05-02 15:45:42 -04:00
|
|
|
When the {dfeed} starts, you receive the following results:
|
2019-09-06 09:22:08 -04:00
|
|
|
|
|
|
|
[source,console-result]
|
2017-04-04 18:26:39 -04:00
|
|
|
----
|
|
|
|
{
|
2017-04-10 11:59:27 -04:00
|
|
|
"started": true
|
2017-04-04 18:26:39 -04:00
|
|
|
}
|
|
|
|
----
|