get-dfanalytics.asciidoc 5.2 KB

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