get-dfanalytics.asciidoc 5.3 KB

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