2017-06-19 18:23:58 -07:00
|
|
|
[role="xpack"]
|
2018-08-31 16:49:24 -07:00
|
|
|
[testenv="platinum"]
|
2017-04-04 15:26:39 -07:00
|
|
|
[[ml-get-influencer]]
|
2018-12-20 10:23:28 -08:00
|
|
|
=== Get influencers API
|
2017-12-14 10:52:49 -08:00
|
|
|
++++
|
2018-12-20 10:23:28 -08:00
|
|
|
<titleabbrev>Get influencers</titleabbrev>
|
2017-12-14 10:52:49 -08:00
|
|
|
++++
|
2017-04-04 15:26:39 -07:00
|
|
|
|
2019-07-30 10:52:23 -07:00
|
|
|
Retrieves {anomaly-job} results for one or more influencers.
|
2017-04-04 15:26:39 -07:00
|
|
|
|
2019-06-27 09:42:47 -07:00
|
|
|
[[ml-get-influencer-request]]
|
|
|
|
==== {api-request-title}
|
2017-04-04 15:26:39 -07:00
|
|
|
|
2018-12-07 20:34:11 +00:00
|
|
|
`GET _ml/anomaly_detectors/<job_id>/results/influencers`
|
2017-04-04 15:26:39 -07:00
|
|
|
|
2019-06-27 13:58:42 -07:00
|
|
|
[[ml-get-influencer-prereqs]]
|
|
|
|
==== {api-prereq-title}
|
|
|
|
|
|
|
|
* If the {es} {security-features} are enabled, you must have `monitor_ml`,
|
|
|
|
`monitor`, `manage_ml`, or `manage` cluster privileges to use this API. You also
|
|
|
|
need `read` index privilege on the index that stores the results. The
|
|
|
|
`machine_learning_admin` and `machine_learning_user` roles provide these
|
2019-10-07 15:23:19 -07:00
|
|
|
privileges. See <<security-privileges>> and
|
|
|
|
<<built-in-roles>>.
|
2019-06-27 13:58:42 -07:00
|
|
|
|
2019-06-27 09:42:47 -07:00
|
|
|
[[ml-get-influencer-path-parms]]
|
|
|
|
==== {api-path-parms-title}
|
2017-04-04 15:26:39 -07:00
|
|
|
|
2019-07-12 08:26:31 -07:00
|
|
|
`<job_id>`::
|
2019-12-27 13:30:26 -08:00
|
|
|
(Required, string)
|
|
|
|
include::{docdir}/ml/ml-shared.asciidoc[tag=job-id-anomaly-detection]
|
2017-04-04 15:26:39 -07:00
|
|
|
|
2019-06-27 09:42:47 -07:00
|
|
|
[[ml-get-influencer-request-body]]
|
|
|
|
==== {api-request-body-title}
|
2017-04-10 16:14:26 -07:00
|
|
|
|
2019-07-12 08:26:31 -07:00
|
|
|
`desc`::
|
|
|
|
(Optional, boolean) If true, the results are sorted in descending order.
|
2017-04-10 16:14:26 -07:00
|
|
|
|
2019-07-12 08:26:31 -07:00
|
|
|
`end`::
|
|
|
|
(Optional, string) Returns influencers with timestamps earlier than this time.
|
2017-04-10 16:14:26 -07:00
|
|
|
|
2019-07-12 08:26:31 -07:00
|
|
|
`exclude_interim`::
|
|
|
|
(Optional, boolean) If true, the output excludes interim results. By default,
|
|
|
|
interim results are included.
|
2017-04-24 10:46:17 -07:00
|
|
|
|
2019-07-12 08:26:31 -07:00
|
|
|
`influencer_score`::
|
|
|
|
(Optional, double) Returns influencers with anomaly scores greater than or
|
|
|
|
equal to this value.
|
2017-04-10 16:14:26 -07:00
|
|
|
|
2019-07-12 08:26:31 -07:00
|
|
|
`page`::
|
2017-05-08 06:53:04 -07:00
|
|
|
`from`:::
|
2019-07-12 08:26:31 -07:00
|
|
|
(Optional, integer) Skips the specified number of influencers.
|
2017-05-08 06:53:04 -07:00
|
|
|
`size`:::
|
2019-07-12 08:26:31 -07:00
|
|
|
(Optional, integer) Specifies the maximum number of influencers to obtain.
|
2017-04-10 16:14:26 -07:00
|
|
|
|
2019-07-12 08:26:31 -07:00
|
|
|
`sort`::
|
|
|
|
(Optional, string) Specifies the sort field for the requested influencers. By
|
|
|
|
default, the influencers are sorted by the `influencer_score` value.
|
2017-04-04 15:26:39 -07:00
|
|
|
|
2019-07-12 08:26:31 -07:00
|
|
|
`start`::
|
|
|
|
(Optional, string) Returns influencers with timestamps after this time.
|
2017-04-04 15:26:39 -07:00
|
|
|
|
2019-06-27 09:42:47 -07:00
|
|
|
[[ml-get-influencer-results]]
|
|
|
|
==== {api-response-body-title}
|
2017-04-10 16:14:26 -07:00
|
|
|
|
|
|
|
The API returns the following information:
|
2017-04-04 15:26:39 -07:00
|
|
|
|
2017-04-10 16:14:26 -07:00
|
|
|
`influencers`::
|
2017-04-11 19:26:18 -07:00
|
|
|
(array) An array of influencer objects.
|
2017-04-10 16:14:26 -07:00
|
|
|
For more information, see <<ml-results-influencers,Influencers>>.
|
2017-04-04 15:26:39 -07:00
|
|
|
|
2019-06-27 09:42:47 -07:00
|
|
|
[[ml-get-influencer-example]]
|
|
|
|
==== {api-examples-title}
|
2017-04-04 15:26:39 -07:00
|
|
|
|
2017-04-10 16:14:26 -07:00
|
|
|
The following example gets influencer information for the `it_ops_new_kpi` job:
|
|
|
|
|
2019-09-06 11:31:13 -04:00
|
|
|
[source,console]
|
2017-04-10 16:14:26 -07:00
|
|
|
--------------------------------------------------
|
2018-12-07 20:34:11 +00:00
|
|
|
GET _ml/anomaly_detectors/it_ops_new_kpi/results/influencers
|
2017-04-10 16:14:26 -07:00
|
|
|
{
|
|
|
|
"sort": "influencer_score",
|
|
|
|
"desc": true
|
|
|
|
}
|
|
|
|
--------------------------------------------------
|
|
|
|
// TEST[skip:todo]
|
|
|
|
|
|
|
|
In this example, the API returns the following information, sorted based on the
|
|
|
|
influencer score in descending order:
|
2017-04-21 11:23:27 -04:00
|
|
|
[source,js]
|
2017-04-04 15:26:39 -07:00
|
|
|
----
|
|
|
|
{
|
2017-04-11 18:52:47 -07:00
|
|
|
"count": 28,
|
2017-04-10 16:14:26 -07:00
|
|
|
"influencers": [
|
|
|
|
{
|
|
|
|
"job_id": "it_ops_new_kpi",
|
|
|
|
"result_type": "influencer",
|
|
|
|
"influencer_field_name": "kpi_indicator",
|
|
|
|
"influencer_field_value": "online_purchases",
|
|
|
|
"kpi_indicator": "online_purchases",
|
|
|
|
"influencer_score": 94.1386,
|
|
|
|
"initial_influencer_score": 94.1386,
|
|
|
|
"probability": 0.000111612,
|
|
|
|
"bucket_span": 600,
|
|
|
|
"is_interim": false,
|
|
|
|
"timestamp": 1454943600000
|
|
|
|
},
|
|
|
|
...
|
2017-04-04 15:26:39 -07:00
|
|
|
]
|
|
|
|
}
|
|
|
|
----
|