2018-10-05 11:45:46 -04:00
|
|
|
--
|
|
|
|
:api: put-datafeed
|
|
|
|
:request: PutDatafeedRequest
|
|
|
|
:response: PutDatafeedResponse
|
|
|
|
--
|
2019-09-10 11:26:56 -04:00
|
|
|
[role="xpack"]
|
2018-10-05 11:45:46 -04:00
|
|
|
[id="{upid}-{api}"]
|
2019-07-26 13:47:03 -04:00
|
|
|
=== Put datafeed API
|
2018-09-12 09:52:36 -04:00
|
|
|
|
2019-07-26 13:47:03 -04:00
|
|
|
Creates a new {ml} datafeed in the cluster. The API accepts a +{request}+ object
|
2018-10-05 11:45:46 -04:00
|
|
|
as a request and returns a +{response}+.
|
2018-09-12 09:52:36 -04:00
|
|
|
|
2018-10-05 11:45:46 -04:00
|
|
|
[id="{upid}-{api}-request"]
|
2019-07-26 13:47:03 -04:00
|
|
|
==== Put datafeed request
|
2018-09-12 09:52:36 -04:00
|
|
|
|
2018-10-05 11:45:46 -04:00
|
|
|
A +{request}+ requires the following argument:
|
2018-09-12 09:52:36 -04:00
|
|
|
|
|
|
|
["source","java",subs="attributes,callouts,macros"]
|
|
|
|
--------------------------------------------------
|
2018-10-05 11:45:46 -04:00
|
|
|
include-tagged::{doc-tests-file}[{api}-request]
|
2018-09-12 09:52:36 -04:00
|
|
|
--------------------------------------------------
|
2019-07-26 13:47:03 -04:00
|
|
|
<1> The configuration of the {ml} datafeed to create.
|
2018-09-12 09:52:36 -04:00
|
|
|
|
2018-10-05 11:45:46 -04:00
|
|
|
[id="{upid}-{api}-config"]
|
2019-07-26 13:47:03 -04:00
|
|
|
==== Datafeed configuration
|
2018-09-12 09:52:36 -04:00
|
|
|
|
|
|
|
The `DatafeedConfig` object contains all the details about the {ml} datafeed
|
|
|
|
configuration.
|
|
|
|
|
|
|
|
A `DatafeedConfig` requires the following arguments:
|
|
|
|
|
|
|
|
["source","java",subs="attributes,callouts,macros"]
|
|
|
|
--------------------------------------------------
|
2018-10-05 11:45:46 -04:00
|
|
|
include-tagged::{doc-tests-file}[{api}-config]
|
2018-09-12 09:52:36 -04:00
|
|
|
--------------------------------------------------
|
2019-07-26 13:47:03 -04:00
|
|
|
<1> The datafeed ID and the {anomaly-job} ID.
|
|
|
|
<2> The indices that contain the data to retrieve and feed into the {anomaly-job}.
|
2018-09-12 09:52:36 -04:00
|
|
|
|
2019-07-26 13:47:03 -04:00
|
|
|
==== Optional arguments
|
2018-09-12 09:52:36 -04:00
|
|
|
The following arguments are optional:
|
|
|
|
|
|
|
|
["source","java",subs="attributes,callouts,macros"]
|
|
|
|
--------------------------------------------------
|
2018-10-05 11:45:46 -04:00
|
|
|
include-tagged::{doc-tests-file}[{api}-config-set-chunking-config]
|
2018-09-12 09:52:36 -04:00
|
|
|
--------------------------------------------------
|
|
|
|
<1> Specifies how data searches are split into time chunks.
|
|
|
|
|
|
|
|
["source","java",subs="attributes,callouts,macros"]
|
|
|
|
--------------------------------------------------
|
2018-10-05 11:45:46 -04:00
|
|
|
include-tagged::{doc-tests-file}[{api}-config-set-frequency]
|
2018-09-12 09:52:36 -04:00
|
|
|
--------------------------------------------------
|
2019-07-26 13:47:03 -04:00
|
|
|
<1> The interval at which scheduled queries are made while the datafeed runs in
|
|
|
|
real time.
|
2018-09-12 09:52:36 -04:00
|
|
|
|
|
|
|
["source","java",subs="attributes,callouts,macros"]
|
|
|
|
--------------------------------------------------
|
2018-10-05 11:45:46 -04:00
|
|
|
include-tagged::{doc-tests-file}[{api}-config-set-query]
|
2018-09-12 09:52:36 -04:00
|
|
|
--------------------------------------------------
|
|
|
|
<1> A query to filter the search results by. Defaults to the `match_all` query.
|
|
|
|
|
|
|
|
["source","java",subs="attributes,callouts,macros"]
|
|
|
|
--------------------------------------------------
|
2018-10-05 11:45:46 -04:00
|
|
|
include-tagged::{doc-tests-file}[{api}-config-set-query-delay]
|
2018-09-12 09:52:36 -04:00
|
|
|
--------------------------------------------------
|
|
|
|
<1> The time interval behind real time that data is queried.
|
|
|
|
|
|
|
|
["source","java",subs="attributes,callouts,macros"]
|
2018-11-15 14:32:45 -05:00
|
|
|
--------------------------------------------------
|
|
|
|
include-tagged::{doc-tests-file}[{api}-config-set-delayed-data-check-config]
|
|
|
|
--------------------------------------------------
|
|
|
|
<1> Sets the delayed data check configuration.
|
|
|
|
The window must be larger than the Job's bucket size, but smaller than 24 hours,
|
|
|
|
and span less than 10,000 buckets.
|
|
|
|
Defaults to `null`, which causes an appropriate window span to be calculated when
|
|
|
|
the datafeed runs.
|
2019-07-26 13:47:03 -04:00
|
|
|
The default `check_window` span calculation is the max between `2h` or
|
|
|
|
`8 * bucket_span`. To explicitly disable, pass
|
|
|
|
`DelayedDataCheckConfig.disabledDelayedDataCheckConfig()`.
|
2018-11-15 14:32:45 -05:00
|
|
|
|
|
|
|
["source","java",subs="attributes,callouts,macros"]
|
2018-09-12 09:52:36 -04:00
|
|
|
--------------------------------------------------
|
2018-10-05 11:45:46 -04:00
|
|
|
include-tagged::{doc-tests-file}[{api}-config-set-script-fields]
|
2018-09-12 09:52:36 -04:00
|
|
|
--------------------------------------------------
|
|
|
|
<1> Allows the use of script fields.
|
|
|
|
|
|
|
|
["source","java",subs="attributes,callouts,macros"]
|
|
|
|
--------------------------------------------------
|
2018-10-05 11:45:46 -04:00
|
|
|
include-tagged::{doc-tests-file}[{api}-config-set-scroll-size]
|
2018-09-12 09:52:36 -04:00
|
|
|
--------------------------------------------------
|
|
|
|
<1> The `size` parameter used in the searches.
|
|
|
|
|
2018-10-05 11:45:46 -04:00
|
|
|
include::../execution.asciidoc[]
|
2018-09-12 09:52:36 -04:00
|
|
|
|
2018-10-05 11:45:46 -04:00
|
|
|
[id="{upid}-{api}-response"]
|
2018-09-12 09:52:36 -04:00
|
|
|
==== Response
|
|
|
|
|
2018-10-05 11:45:46 -04:00
|
|
|
The returned +{response}+ returns the full representation of
|
2018-09-12 09:52:36 -04:00
|
|
|
the new {ml} datafeed if it has been successfully created. This will
|
|
|
|
contain the creation time and other fields initialized using
|
|
|
|
default values:
|
|
|
|
|
|
|
|
["source","java",subs="attributes,callouts,macros"]
|
|
|
|
--------------------------------------------------
|
2018-10-05 11:45:46 -04:00
|
|
|
include-tagged::{doc-tests-file}[{api}-response]
|
2018-09-12 09:52:36 -04:00
|
|
|
--------------------------------------------------
|
2019-07-26 13:47:03 -04:00
|
|
|
<1> The created datafeed.
|