123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259 |
- [[get-dfanalytics]]
- = Get {dfanalytics-jobs} API
- [subs="attributes"]
- ++++
- <titleabbrev>Get {dfanalytics-jobs}</titleabbrev>
- ++++
- Retrieves configuration information for {dfanalytics-jobs}.
- [[ml-get-dfanalytics-request]]
- == {api-request-title}
- `GET _ml/data_frame/analytics/<data_frame_analytics_id>` +
- `GET _ml/data_frame/analytics/<data_frame_analytics_id>,<data_frame_analytics_id>` +
- `GET _ml/data_frame/analytics/` +
- `GET _ml/data_frame/analytics/_all`
- [[ml-get-dfanalytics-prereq]]
- == {api-prereq-title}
- Requires the `monitor_ml` cluster privilege. This privilege is included in the
- `machine_learning_user` built-in role.
- [[ml-get-dfanalytics-desc]]
- == {api-description-title}
- You can get information for multiple {dfanalytics-jobs} in a single API request
- by using a comma-separated list of {dfanalytics-jobs} or a wildcard expression.
- [[ml-get-dfanalytics-path-params]]
- == {api-path-parms-title}
- `<data_frame_analytics_id>`::
- (Optional, string)
- include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=job-id-data-frame-analytics-default]
- +
- --
- You can get information for all {dfanalytics-jobs} by using _all, by specifying
- `*` as the `<data_frame_analytics_id>`, or by omitting the
- `<data_frame_analytics_id>`.
- --
- [[ml-get-dfanalytics-query-params]]
- == {api-query-parms-title}
- `allow_no_match`::
- (Optional, Boolean)
- include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=allow-no-match-dfa-jobs]
- `exclude_generated`::
- (Optional, Boolean)
- include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=exclude-generated]
- `from`::
- (Optional, integer)
- include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=from]
- `size`::
- (Optional, integer)
- include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=size]
- [role="child_attributes"]
- [[ml-get-dfanalytics-results]]
- == {api-response-body-title}
- `data_frame_analytics`::
- (array)
- An array of {dfanalytics-job} resources, which are sorted by the `id` value in
- ascending order.
- +
- .Properties of {dfanalytics-job} resources
- [%collapsible%open]
- ====
- `analysis`:::
- (object) The type of analysis that is performed on the `source`.
- //Begin analyzed_fields
- `analyzed_fields`:::
- (object) Contains `includes` and/or `excludes` patterns that select which fields
- are included in the analysis.
- +
- .Properties of `analyzed_fields`
- [%collapsible%open]
- =====
- `excludes`:::
- (Optional, array) An array of strings that defines the fields that are excluded
- from the analysis.
- `includes`:::
- (Optional, array) An array of strings that defines the fields that are included
- in the analysis.
- =====
- //End analyzed_fields
- //Begin authorization
- `authorization`:::
- (object)
- The security privileges that the job uses to run its queries. If
- {stack-security-features} were disabled at the time of the most recent update to
- the job, this property is omitted.
- +
- .Properties of `authorization`
- [%collapsible%open]
- =====
- `api_key`:::
- (object) If an API key was used for the most recent update to the job, its name
- and identifier are listed in the response.
- +
- .Properties of `api_key`
- [%collapsible%open]
- ======
- `id`::::
- (string) The identifier for the API key.
- `name`::::
- (string) The name of the API key.
- ======
- `roles`:::
- (array of strings) If a user ID was used for the most recent update to the job,
- its roles at the time of the update are listed in the response.
- `service_account`:::
- (string) If a service account was used for the most recent update to the job,
- the account name is listed in the response.
- =====
- //End authorization
- //Begin dest
- `dest`:::
- (string) The destination configuration of the analysis.
- +
- .Properties of `dest`
- [%collapsible%open]
- =====
- `index`:::
- (string) The _destination index_ that stores the results of the
- {dfanalytics-job}.
- `results_field`:::
- (string) The name of the field that stores the results of the analysis. Defaults
- to `ml`.
- =====
- //End dest
- `id`:::
- (string) The unique identifier of the {dfanalytics-job}.
- `model_memory_limit`:::
- (string) The `model_memory_limit` that has been set for the {dfanalytics-job}.
- `source`:::
- (object) The configuration of how the analysis data is sourced. It has an
- `index` parameter and optionally a `query` and a `_source`.
- +
- .Properties of `source`
- [%collapsible%open]
- =====
- `index`:::
- (array) Index or indices on which to perform the analysis. It can be a single
- index or index pattern as well as an array of indices or patterns.
- `query`:::
- (object) The query that has been specified for the {dfanalytics-job}. The {es}
- query domain-specific language (<<query-dsl,DSL>>). This value corresponds to
- the query object in an {es} search POST body. By default, this property has the
- following value: `{"match_all": {}}`.
- `_source`:::
- (object) Contains the specified `includes` and/or `excludes` patterns that
- select which fields are present in the destination. Fields that are excluded
- cannot be included in the analysis.
- +
- .Properties of `_source`
- [%collapsible%open]
- ======
- `excludes`:::
- (array) An array of strings that defines the fields that are excluded from the
- destination.
- `includes`:::
- (array) An array of strings that defines the fields that are included in the
- destination.
- ======
- //End of _source
- =====
- //End source
- ====
- [[ml-get-dfanalytics-response-codes]]
- == {api-response-codes-title}
- `404` (Missing resources)::
- If `allow_no_match` is `false`, this code indicates that there are no
- resources that match the request or only partial matches for the request.
- [[ml-get-dfanalytics-example]]
- == {api-examples-title}
- The following example gets configuration information for the `loganalytics`
- {dfanalytics-job}:
- [source,console]
- --------------------------------------------------
- GET _ml/data_frame/analytics/loganalytics
- --------------------------------------------------
- // TEST[skip:TBD]
- The API returns the following results:
- [source,console-result]
- ----
- {
- "count" : 1,
- "data_frame_analytics" : [
- {
- "id" : "loganalytics",
- "create_time" : 1656364565517,
- "version" : "8.4.0",
- "authorization" : {
- "roles" : [
- "superuser"
- ]
- },
- "description" : "Outlier detection on log data",
- "source" : {
- "index" : [
- "logdata"
- ],
- "query" : {
- "match_all" : { }
- }
- },
- "dest" : {
- "index" : "logdata_out",
- "results_field" : "ml"
- },
- "analysis" : {
- "outlier_detection" : {
- "compute_feature_influence" : true,
- "outlier_fraction" : 0.05,
- "standardization_enabled" : true
- }
- },
- "model_memory_limit" : "1gb",
- "allow_lazy_start" : false,
- "max_num_threads" : 1
- }
- ]
- }
- ----
|