get-datafeed.asciidoc 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. [role="xpack"]
  2. [testenv="platinum"]
  3. [[ml-get-datafeed]]
  4. === Get {dfeeds} API
  5. [subs="attributes"]
  6. ++++
  7. <titleabbrev>Get {dfeeds}</titleabbrev>
  8. ++++
  9. Retrieves configuration information for {dfeeds}.
  10. [[ml-get-datafeed-request]]
  11. ==== {api-request-title}
  12. `GET _ml/datafeeds/<feed_id>` +
  13. `GET _ml/datafeeds/<feed_id>,<feed_id>` +
  14. `GET _ml/datafeeds/` +
  15. `GET _ml/datafeeds/_all`
  16. [[ml-get-datafeed-prereqs]]
  17. ==== {api-prereq-title}
  18. * If the {es} {security-features} are enabled, you must have `monitor_ml`,
  19. `monitor`, `manage_ml`, or `manage` cluster privileges to use this API. See
  20. <<security-privileges>>.
  21. [[ml-get-datafeed-desc]]
  22. ==== {api-description-title}
  23. You can get information for multiple {dfeeds} in a single API request by using a
  24. comma-separated list of {dfeeds} or a wildcard expression. You can get
  25. information for all {dfeeds} by using `_all`, by specifying `*` as the
  26. `<feed_id>`, or by omitting the `<feed_id>`.
  27. IMPORTANT: This API returns a maximum of 10,000 {dfeeds}.
  28. [[ml-get-datafeed-path-parms]]
  29. ==== {api-path-parms-title}
  30. `<feed_id>`::
  31. (Optional, string)
  32. include::{docdir}/ml/ml-shared.asciidoc[tag=datafeed-id-wildcard]
  33. If you do not specify one of these options, the API returns information about
  34. all {dfeeds}.
  35. [[ml-get-datafeed-query-parms]]
  36. ==== {api-query-parms-title}
  37. `allow_no_datafeeds`::
  38. (Optional, boolean)
  39. include::{docdir}/ml/ml-shared.asciidoc[tag=allow-no-datafeeds]
  40. [[ml-get-datafeed-results]]
  41. ==== {api-response-body-title}
  42. The API returns an array of {dfeed} resources, which have the following
  43. properties:
  44. `aggregations`::
  45. (object)
  46. include::{docdir}/ml/ml-shared.asciidoc[tag=aggregations]
  47. `chunking_config`::
  48. (object)
  49. include::{docdir}/ml/ml-shared.asciidoc[tag=chunking-config]
  50. `datafeed_id`::
  51. (string)
  52. include::{docdir}/ml/ml-shared.asciidoc[tag=datafeed-id]
  53. `delayed_data_check_config`::
  54. (object)
  55. include::{docdir}/ml/ml-shared.asciidoc[tag=delayed-data-check-config]
  56. `frequency`::
  57. (<<time-units,time units>>)
  58. include::{docdir}/ml/ml-shared.asciidoc[tag=frequency]
  59. `indices`::
  60. (array)
  61. include::{docdir}/ml/ml-shared.asciidoc[tag=indices]
  62. `job_id`::
  63. (string)
  64. include::{docdir}/ml/ml-shared.asciidoc[tag=job-id-datafeed]
  65. `max_empty_searches`::
  66. (integer)
  67. include::{docdir}/ml/ml-shared.asciidoc[tag=max-empty-searches]
  68. `query`::
  69. (object)
  70. include::{docdir}/ml/ml-shared.asciidoc[tag=query]
  71. `query_delay`::
  72. (<<time-units,time units>>)
  73. include::{docdir}/ml/ml-shared.asciidoc[tag=query-delay]
  74. `script_fields`::
  75. (object)
  76. include::{docdir}/ml/ml-shared.asciidoc[tag=script-fields]
  77. `scroll_size`::
  78. (unsigned integer)
  79. include::{docdir}/ml/ml-shared.asciidoc[tag=scroll-size]
  80. [[ml-get-datafeed-response-codes]]
  81. ==== {api-response-codes-title}
  82. `404` (Missing resources)::
  83. If `allow_no_datafeeds` is `false`, this code indicates that there are no
  84. resources that match the request or only partial matches for the request.
  85. [[ml-get-datafeed-example]]
  86. ==== {api-examples-title}
  87. The following example gets configuration information for the
  88. `datafeed-high_sum_total_sales` {dfeed}:
  89. [source,console]
  90. --------------------------------------------------
  91. GET _ml/datafeeds/datafeed-high_sum_total_sales
  92. --------------------------------------------------
  93. // TEST[skip:kibana sample data]
  94. The API returns the following results:
  95. [source,console-result]
  96. ----
  97. {
  98. "count" : 1,
  99. "datafeeds" : [
  100. {
  101. "datafeed_id" : "datafeed-high_sum_total_sales",
  102. "job_id" : "high_sum_total_sales",
  103. "query_delay" : "93169ms",
  104. "indices" : [
  105. "kibana_sample_data_ecommerce"
  106. ],
  107. "query" : {
  108. "bool" : {
  109. "filter" : [
  110. {
  111. "term" : {
  112. "_index" : "kibana_sample_data_ecommerce"
  113. }
  114. }
  115. ]
  116. }
  117. },
  118. "scroll_size" : 1000,
  119. "chunking_config" : {
  120. "mode" : "auto"
  121. },
  122. "delayed_data_check_config" : {
  123. "enabled" : true
  124. }
  125. }
  126. ]
  127. }
  128. ----
  129. // TESTRESPONSE[s/"query.boost": "93169ms"/"query.boost": $body.query.boost/]