get-dfanalytics.asciidoc 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259
  1. [[get-dfanalytics]]
  2. = Get {dfanalytics-jobs} API
  3. [subs="attributes"]
  4. ++++
  5. <titleabbrev>Get {dfanalytics-jobs}</titleabbrev>
  6. ++++
  7. Retrieves configuration information for {dfanalytics-jobs}.
  8. [[ml-get-dfanalytics-request]]
  9. == {api-request-title}
  10. `GET _ml/data_frame/analytics/<data_frame_analytics_id>` +
  11. `GET _ml/data_frame/analytics/<data_frame_analytics_id>,<data_frame_analytics_id>` +
  12. `GET _ml/data_frame/analytics/` +
  13. `GET _ml/data_frame/analytics/_all`
  14. [[ml-get-dfanalytics-prereq]]
  15. == {api-prereq-title}
  16. Requires the `monitor_ml` cluster privilege. This privilege is included in the
  17. `machine_learning_user` built-in role.
  18. [[ml-get-dfanalytics-desc]]
  19. == {api-description-title}
  20. You can get information for multiple {dfanalytics-jobs} in a single API request
  21. by using a comma-separated list of {dfanalytics-jobs} or a wildcard expression.
  22. [[ml-get-dfanalytics-path-params]]
  23. == {api-path-parms-title}
  24. `<data_frame_analytics_id>`::
  25. (Optional, string)
  26. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=job-id-data-frame-analytics-default]
  27. +
  28. --
  29. You can get information for all {dfanalytics-jobs} by using _all, by specifying
  30. `*` as the `<data_frame_analytics_id>`, or by omitting the
  31. `<data_frame_analytics_id>`.
  32. --
  33. [[ml-get-dfanalytics-query-params]]
  34. == {api-query-parms-title}
  35. `allow_no_match`::
  36. (Optional, Boolean)
  37. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=allow-no-match-dfa-jobs]
  38. `exclude_generated`::
  39. (Optional, Boolean)
  40. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=exclude-generated]
  41. `from`::
  42. (Optional, integer)
  43. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=from]
  44. `size`::
  45. (Optional, integer)
  46. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=size]
  47. [role="child_attributes"]
  48. [[ml-get-dfanalytics-results]]
  49. == {api-response-body-title}
  50. `data_frame_analytics`::
  51. (array)
  52. An array of {dfanalytics-job} resources, which are sorted by the `id` value in
  53. ascending order.
  54. +
  55. .Properties of {dfanalytics-job} resources
  56. [%collapsible%open]
  57. ====
  58. `analysis`:::
  59. (object) The type of analysis that is performed on the `source`.
  60. //Begin analyzed_fields
  61. `analyzed_fields`:::
  62. (object) Contains `includes` and/or `excludes` patterns that select which fields
  63. are included in the analysis.
  64. +
  65. .Properties of `analyzed_fields`
  66. [%collapsible%open]
  67. =====
  68. `excludes`:::
  69. (Optional, array) An array of strings that defines the fields that are excluded
  70. from the analysis.
  71. `includes`:::
  72. (Optional, array) An array of strings that defines the fields that are included
  73. in the analysis.
  74. =====
  75. //End analyzed_fields
  76. //Begin authorization
  77. `authorization`:::
  78. (object)
  79. The security privileges that the job uses to run its queries. If
  80. {stack-security-features} were disabled at the time of the most recent update to
  81. the job, this property is omitted.
  82. +
  83. .Properties of `authorization`
  84. [%collapsible%open]
  85. =====
  86. `api_key`:::
  87. (object) If an API key was used for the most recent update to the job, its name
  88. and identifier are listed in the response.
  89. +
  90. .Properties of `api_key`
  91. [%collapsible%open]
  92. ======
  93. `id`::::
  94. (string) The identifier for the API key.
  95. `name`::::
  96. (string) The name of the API key.
  97. ======
  98. `roles`:::
  99. (array of strings) If a user ID was used for the most recent update to the job,
  100. its roles at the time of the update are listed in the response.
  101. `service_account`:::
  102. (string) If a service account was used for the most recent update to the job,
  103. the account name is listed in the response.
  104. =====
  105. //End authorization
  106. //Begin dest
  107. `dest`:::
  108. (string) The destination configuration of the analysis.
  109. +
  110. .Properties of `dest`
  111. [%collapsible%open]
  112. =====
  113. `index`:::
  114. (string) The _destination index_ that stores the results of the
  115. {dfanalytics-job}.
  116. `results_field`:::
  117. (string) The name of the field that stores the results of the analysis. Defaults
  118. to `ml`.
  119. =====
  120. //End dest
  121. `id`:::
  122. (string) The unique identifier of the {dfanalytics-job}.
  123. `model_memory_limit`:::
  124. (string) The `model_memory_limit` that has been set for the {dfanalytics-job}.
  125. `source`:::
  126. (object) The configuration of how the analysis data is sourced. It has an
  127. `index` parameter and optionally a `query` and a `_source`.
  128. +
  129. .Properties of `source`
  130. [%collapsible%open]
  131. =====
  132. `index`:::
  133. (array) Index or indices on which to perform the analysis. It can be a single
  134. index or index pattern as well as an array of indices or patterns.
  135. `query`:::
  136. (object) The query that has been specified for the {dfanalytics-job}. The {es}
  137. query domain-specific language (<<query-dsl,DSL>>). This value corresponds to
  138. the query object in an {es} search POST body. By default, this property has the
  139. following value: `{"match_all": {}}`.
  140. `_source`:::
  141. (object) Contains the specified `includes` and/or `excludes` patterns that
  142. select which fields are present in the destination. Fields that are excluded
  143. cannot be included in the analysis.
  144. +
  145. .Properties of `_source`
  146. [%collapsible%open]
  147. ======
  148. `excludes`:::
  149. (array) An array of strings that defines the fields that are excluded from the
  150. destination.
  151. `includes`:::
  152. (array) An array of strings that defines the fields that are included in the
  153. destination.
  154. ======
  155. //End of _source
  156. =====
  157. //End source
  158. ====
  159. [[ml-get-dfanalytics-response-codes]]
  160. == {api-response-codes-title}
  161. `404` (Missing resources)::
  162. If `allow_no_match` is `false`, this code indicates that there are no
  163. resources that match the request or only partial matches for the request.
  164. [[ml-get-dfanalytics-example]]
  165. == {api-examples-title}
  166. The following example gets configuration information for the `loganalytics`
  167. {dfanalytics-job}:
  168. [source,console]
  169. --------------------------------------------------
  170. GET _ml/data_frame/analytics/loganalytics
  171. --------------------------------------------------
  172. // TEST[skip:TBD]
  173. The API returns the following results:
  174. [source,console-result]
  175. ----
  176. {
  177. "count" : 1,
  178. "data_frame_analytics" : [
  179. {
  180. "id" : "loganalytics",
  181. "create_time" : 1656364565517,
  182. "version" : "8.4.0",
  183. "authorization" : {
  184. "roles" : [
  185. "superuser"
  186. ]
  187. },
  188. "description" : "Outlier detection on log data",
  189. "source" : {
  190. "index" : [
  191. "logdata"
  192. ],
  193. "query" : {
  194. "match_all" : { }
  195. }
  196. },
  197. "dest" : {
  198. "index" : "logdata_out",
  199. "results_field" : "ml"
  200. },
  201. "analysis" : {
  202. "outlier_detection" : {
  203. "compute_feature_influence" : true,
  204. "outlier_fraction" : 0.05,
  205. "standardization_enabled" : true
  206. }
  207. },
  208. "model_memory_limit" : "1gb",
  209. "allow_lazy_start" : false,
  210. "max_num_threads" : 1
  211. }
  212. ]
  213. }
  214. ----