get-dfanalytics.asciidoc 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216
  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. [role="child_attributes"]
  50. [[ml-get-dfanalytics-results]]
  51. == {api-response-body-title}
  52. `data_frame_analytics`::
  53. (array)
  54. An array of {dfanalytics-job} resources, which are sorted by the `id` value in
  55. ascending order.
  56. +
  57. .Properties of {dfanalytics-job} resources
  58. [%collapsible%open]
  59. ====
  60. `analysis`:::
  61. (object) The type of analysis that is performed on the `source`.
  62. //Begin analyzed_fields
  63. `analyzed_fields`:::
  64. (object) Contains `includes` and/or `excludes` patterns that select which fields
  65. are included in the analysis.
  66. +
  67. .Properties of `analyzed_fields`
  68. [%collapsible%open]
  69. =====
  70. `excludes`:::
  71. (Optional, array) An array of strings that defines the fields that are excluded
  72. from the analysis.
  73. `includes`:::
  74. (Optional, array) An array of strings that defines the fields that are included
  75. in the analysis.
  76. =====
  77. //End analyzed_fields
  78. //Begin dest
  79. `dest`:::
  80. (string) The destination configuration of the analysis.
  81. +
  82. .Properties of `dest`
  83. [%collapsible%open]
  84. =====
  85. `index`:::
  86. (string) The _destination index_ that stores the results of the
  87. {dfanalytics-job}.
  88. `results_field`:::
  89. (string) The name of the field that stores the results of the analysis. Defaults
  90. to `ml`.
  91. =====
  92. //End dest
  93. `id`:::
  94. (string) The unique identifier of the {dfanalytics-job}.
  95. `model_memory_limit`:::
  96. (string) The `model_memory_limit` that has been set to the {dfanalytics-job}.
  97. `source`:::
  98. (object) The configuration of how the analysis data is sourced. It has an
  99. `index` parameter and optionally a `query` and a `_source`.
  100. +
  101. .Properties of `source`
  102. [%collapsible%open]
  103. =====
  104. `index`:::
  105. (array) Index or indices on which to perform the analysis. It can be a single
  106. index or index pattern as well as an array of indices or patterns.
  107. `query`:::
  108. (object) The query that has been specified for the {dfanalytics-job}. The {es}
  109. query domain-specific language (<<query-dsl,DSL>>). This value corresponds to
  110. the query object in an {es} search POST body. By default, this property has the
  111. following value: `{"match_all": {}}`.
  112. `_source`:::
  113. (object) Contains the specified `includes` and/or `excludes` patterns that
  114. select which fields are present in the destination. Fields that are excluded
  115. cannot be included in the analysis.
  116. +
  117. .Properties of `_source`
  118. [%collapsible%open]
  119. ======
  120. `excludes`:::
  121. (array) An array of strings that defines the fields that are excluded from the
  122. destination.
  123. `includes`:::
  124. (array) An array of strings that defines the fields that are included in the
  125. destination.
  126. ======
  127. //End of _source
  128. =====
  129. //End source
  130. ====
  131. [[ml-get-dfanalytics-response-codes]]
  132. == {api-response-codes-title}
  133. `404` (Missing resources)::
  134. If `allow_no_match` is `false`, this code indicates that there are no
  135. resources that match the request or only partial matches for the request.
  136. [[ml-get-dfanalytics-example]]
  137. == {api-examples-title}
  138. The following example gets configuration information for the `loganalytics`
  139. {dfanalytics-job}:
  140. [source,console]
  141. --------------------------------------------------
  142. GET _ml/data_frame/analytics/loganalytics
  143. --------------------------------------------------
  144. // TEST[skip:TBD]
  145. The API returns the following results:
  146. [source,console-result]
  147. ----
  148. {
  149. "count": 1,
  150. "data_frame_analytics": [
  151. {
  152. "id": "loganalytics",
  153. "source": {
  154. "index": "logdata",
  155. "query": {
  156. "match_all": {}
  157. }
  158. },
  159. "dest": {
  160. "index": "logdata_out",
  161. "results_field": "ml"
  162. },
  163. "analysis": {
  164. "outlier_detection": {}
  165. },
  166. "model_memory_limit": "1gb",
  167. "create_time": 1562265491319,
  168. "version": "8.0.0"
  169. }
  170. ]
  171. }
  172. ----