2017-04-11 21:52:47 -04:00
|
|
|
//lcawley: Verified example output 2017-04-11
|
2017-04-04 18:26:39 -04:00
|
|
|
[[ml-preview-datafeed]]
|
|
|
|
==== Preview Data Feeds
|
|
|
|
|
2017-04-11 21:52:47 -04:00
|
|
|
The preview data feed API enables you to preview a data feed.
|
2017-04-04 18:26:39 -04:00
|
|
|
|
|
|
|
===== Request
|
|
|
|
|
2017-04-24 12:31:31 -04:00
|
|
|
`GET _xpack/ml/datafeeds/<datafeed_id>/_preview`
|
2017-04-04 18:26:39 -04:00
|
|
|
|
2017-04-10 11:59:27 -04:00
|
|
|
|
2017-04-04 18:26:39 -04:00
|
|
|
===== Description
|
|
|
|
|
2017-04-24 12:31:31 -04:00
|
|
|
The API returns the first "page" of results from the `search` created using the current data feed settings.
|
|
|
|
This shows the structure of the data that will be passed to the anomaly detection engine.
|
2017-04-10 11:59:27 -04:00
|
|
|
|
2017-04-18 18:13:21 -04:00
|
|
|
You must have `monitor_ml`, `monitor`, `manage_ml`, or `manage` cluster
|
|
|
|
privileges to use this API. For more information, see <<privileges-list-cluster>>.
|
|
|
|
|
2017-04-04 18:26:39 -04:00
|
|
|
===== Path Parameters
|
|
|
|
|
2017-04-24 12:31:31 -04:00
|
|
|
`datafeed_id` (required)::
|
2017-04-11 22:26:18 -04:00
|
|
|
(string) Identifier for the data feed
|
2017-04-04 18:26:39 -04:00
|
|
|
|
|
|
|
////
|
|
|
|
===== Request Body
|
|
|
|
|
2017-04-10 11:59:27 -04:00
|
|
|
None
|
2017-04-04 18:26:39 -04:00
|
|
|
|
|
|
|
===== Responses
|
|
|
|
|
|
|
|
TBD
|
|
|
|
////
|
|
|
|
////
|
|
|
|
200
|
|
|
|
(EmptyResponse) The cluster has been successfully deleted
|
|
|
|
404
|
|
|
|
(BasicFailedReply) The cluster specified by {cluster_id} cannot be found (code: clusters.cluster_not_found)
|
|
|
|
412
|
|
|
|
(BasicFailedReply) The Elasticsearch cluster has not been shutdown yet (code: clusters.cluster_plan_state_error)
|
2017-04-10 11:59:27 -04:00
|
|
|
////
|
2017-04-04 18:26:39 -04:00
|
|
|
===== Examples
|
|
|
|
|
2017-04-24 12:31:31 -04:00
|
|
|
The following example obtains a preview of the `datafeed-farequote` data feed:
|
2017-04-04 18:26:39 -04:00
|
|
|
|
|
|
|
[source,js]
|
|
|
|
--------------------------------------------------
|
2017-04-10 11:59:27 -04:00
|
|
|
GET _xpack/ml/datafeeds/datafeed-farequote/_preview
|
2017-04-04 18:26:39 -04:00
|
|
|
--------------------------------------------------
|
|
|
|
// CONSOLE
|
|
|
|
// TEST[skip:todo]
|
|
|
|
|
2017-04-10 11:59:27 -04:00
|
|
|
The data that is returned for this example is as follows:
|
2017-04-21 11:23:27 -04:00
|
|
|
[source,js]
|
2017-04-04 18:26:39 -04:00
|
|
|
----
|
2017-04-10 11:59:27 -04:00
|
|
|
[
|
|
|
|
{
|
|
|
|
"@timestamp": 1454803200000,
|
2017-04-11 21:52:47 -04:00
|
|
|
"airline": "AAL",
|
2017-04-10 11:59:27 -04:00
|
|
|
"responsetime": 132.20460510253906
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"@timestamp": 1454803200000,
|
2017-04-11 21:52:47 -04:00
|
|
|
"airline": "JZA",
|
2017-04-10 11:59:27 -04:00
|
|
|
"responsetime": 990.4628295898438
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"@timestamp": 1454803200000,
|
2017-04-11 21:52:47 -04:00
|
|
|
"airline": "JBU",
|
2017-04-10 11:59:27 -04:00
|
|
|
"responsetime": 877.5927124023438
|
|
|
|
},
|
2017-04-04 18:26:39 -04:00
|
|
|
...
|
2017-04-10 11:59:27 -04:00
|
|
|
]
|
2017-04-04 18:26:39 -04:00
|
|
|
----
|