get-dfanalytics.asciidoc 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220
  1. [role="xpack"]
  2. [testenv="platinum"]
  3. [[get-dfanalytics]]
  4. = Get {dfanalytics-jobs} API
  5. [subs="attributes"]
  6. ++++
  7. <titleabbrev>Get {dfanalytics-jobs}</titleabbrev>
  8. ++++
  9. Retrieves configuration information for {dfanalytics-jobs}.
  10. experimental[]
  11. [[ml-get-dfanalytics-request]]
  12. == {api-request-title}
  13. `GET _ml/data_frame/analytics/<data_frame_analytics_id>` +
  14. `GET _ml/data_frame/analytics/<data_frame_analytics_id>,<data_frame_analytics_id>` +
  15. `GET _ml/data_frame/analytics/` +
  16. `GET _ml/data_frame/analytics/_all`
  17. [[ml-get-dfanalytics-prereq]]
  18. == {api-prereq-title}
  19. If the {es} {security-features} are enabled, you must have the following
  20. privileges:
  21. * cluster: `monitor_ml`
  22. For more information, see <<security-privileges>> and {ml-docs-setup-privileges}.
  23. [[ml-get-dfanalytics-desc]]
  24. == {api-description-title}
  25. You can get information for multiple {dfanalytics-jobs} in a single API request
  26. by using a comma-separated list of {dfanalytics-jobs} or a wildcard expression.
  27. [[ml-get-dfanalytics-path-params]]
  28. == {api-path-parms-title}
  29. `<data_frame_analytics_id>`::
  30. (Optional, string)
  31. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=job-id-data-frame-analytics-default]
  32. +
  33. --
  34. You can get information for all {dfanalytics-jobs} by using _all, by specifying
  35. `*` as the `<data_frame_analytics_id>`, or by omitting the
  36. `<data_frame_analytics_id>`.
  37. --
  38. [[ml-get-dfanalytics-query-params]]
  39. == {api-query-parms-title}
  40. `allow_no_match`::
  41. (Optional, boolean)
  42. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=allow-no-match]
  43. `from`::
  44. (Optional, integer)
  45. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=from]
  46. `size`::
  47. (Optional, integer)
  48. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=size]
  49. `exclude_generated`::
  50. (Optional, boolean)
  51. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=exclude-generated]
  52. [role="child_attributes"]
  53. [[ml-get-dfanalytics-results]]
  54. == {api-response-body-title}
  55. `data_frame_analytics`::
  56. (array)
  57. An array of {dfanalytics-job} resources, which are sorted by the `id` value in
  58. ascending order.
  59. +
  60. .Properties of {dfanalytics-job} resources
  61. [%collapsible%open]
  62. ====
  63. `analysis`:::
  64. (object) The type of analysis that is performed on the `source`.
  65. //Begin analyzed_fields
  66. `analyzed_fields`:::
  67. (object) Contains `includes` and/or `excludes` patterns that select which fields
  68. are included in the analysis.
  69. +
  70. .Properties of `analyzed_fields`
  71. [%collapsible%open]
  72. =====
  73. `excludes`:::
  74. (Optional, array) An array of strings that defines the fields that are excluded
  75. from the analysis.
  76. `includes`:::
  77. (Optional, array) An array of strings that defines the fields that are included
  78. in the analysis.
  79. =====
  80. //End analyzed_fields
  81. //Begin dest
  82. `dest`:::
  83. (string) The destination configuration of the analysis.
  84. +
  85. .Properties of `dest`
  86. [%collapsible%open]
  87. =====
  88. `index`:::
  89. (string) The _destination index_ that stores the results of the
  90. {dfanalytics-job}.
  91. `results_field`:::
  92. (string) The name of the field that stores the results of the analysis. Defaults
  93. to `ml`.
  94. =====
  95. //End dest
  96. `id`:::
  97. (string) The unique identifier of the {dfanalytics-job}.
  98. `model_memory_limit`:::
  99. (string) The `model_memory_limit` that has been set to the {dfanalytics-job}.
  100. `source`:::
  101. (object) The configuration of how the analysis data is sourced. It has an
  102. `index` parameter and optionally a `query` and a `_source`.
  103. +
  104. .Properties of `source`
  105. [%collapsible%open]
  106. =====
  107. `index`:::
  108. (array) Index or indices on which to perform the analysis. It can be a single
  109. index or index pattern as well as an array of indices or patterns.
  110. `query`:::
  111. (object) The query that has been specified for the {dfanalytics-job}. The {es}
  112. query domain-specific language (<<query-dsl,DSL>>). This value corresponds to
  113. the query object in an {es} search POST body. By default, this property has the
  114. following value: `{"match_all": {}}`.
  115. `_source`:::
  116. (object) Contains the specified `includes` and/or `excludes` patterns that
  117. select which fields are present in the destination. Fields that are excluded
  118. cannot be included in the analysis.
  119. +
  120. .Properties of `_source`
  121. [%collapsible%open]
  122. ======
  123. `excludes`:::
  124. (array) An array of strings that defines the fields that are excluded from the
  125. destination.
  126. `includes`:::
  127. (array) An array of strings that defines the fields that are included in the
  128. destination.
  129. ======
  130. //End of _source
  131. =====
  132. //End source
  133. ====
  134. [[ml-get-dfanalytics-response-codes]]
  135. == {api-response-codes-title}
  136. `404` (Missing resources)::
  137. If `allow_no_match` is `false`, this code indicates that there are no
  138. resources that match the request or only partial matches for the request.
  139. [[ml-get-dfanalytics-example]]
  140. == {api-examples-title}
  141. The following example gets configuration information for the `loganalytics`
  142. {dfanalytics-job}:
  143. [source,console]
  144. --------------------------------------------------
  145. GET _ml/data_frame/analytics/loganalytics
  146. --------------------------------------------------
  147. // TEST[skip:TBD]
  148. The API returns the following results:
  149. [source,console-result]
  150. ----
  151. {
  152. "count": 1,
  153. "data_frame_analytics": [
  154. {
  155. "id": "loganalytics",
  156. "source": {
  157. "index": "logdata",
  158. "query": {
  159. "match_all": {}
  160. }
  161. },
  162. "dest": {
  163. "index": "logdata_out",
  164. "results_field": "ml"
  165. },
  166. "analysis": {
  167. "outlier_detection": {}
  168. },
  169. "model_memory_limit": "1gb",
  170. "create_time": 1562265491319,
  171. "version": "8.0.0"
  172. }
  173. ]
  174. }
  175. ----