start-datafeed.asciidoc 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. [role="xpack"]
  2. [[ml-start-datafeed]]
  3. = Start {dfeeds} API
  4. [subs="attributes"]
  5. ++++
  6. <titleabbrev>Start {dfeeds}</titleabbrev>
  7. ++++
  8. Starts one or more {dfeeds}.
  9. [[ml-start-datafeed-request]]
  10. == {api-request-title}
  11. `POST _ml/datafeeds/<feed_id>/_start`
  12. [[ml-start-datafeed-prereqs]]
  13. == {api-prereq-title}
  14. * Before you can start a {dfeed}, the {anomaly-job} must be open. Otherwise, an
  15. error occurs.
  16. * Requires the `manage_ml` cluster privilege. This privilege is included in the
  17. `machine_learning_admin` built-in role.
  18. [[ml-start-datafeed-desc]]
  19. == {api-description-title}
  20. A {dfeed} must be started in order to retrieve data from {es}.
  21. A {dfeed} can be started and stopped multiple times throughout its lifecycle.
  22. When you start a {dfeed}, you can specify a start time. This enables you to
  23. include a training period, providing you have this data available in {es}.
  24. If you want to analyze from the beginning of a dataset, you can specify any date
  25. earlier than that beginning date.
  26. If you do not specify a start time and the {dfeed} is associated with a new
  27. {anomaly-job}, the analysis starts from the earliest time for which data is
  28. available.
  29. When you start a {dfeed}, you can also specify an end time. If you do so, the
  30. job analyzes data from the start time until the end time, at which point the
  31. analysis stops. This scenario is useful for a one-off batch analysis. If you
  32. do not specify an end time, the {dfeed} runs continuously.
  33. The `start` and `end` times can be specified by using one of the
  34. following formats: +
  35. - ISO 8601 format with milliseconds, for example `2017-01-22T06:00:00.000Z`
  36. - ISO 8601 format without milliseconds, for example `2017-01-22T06:00:00+00:00`
  37. - Milliseconds since the epoch, for example `1485061200000`
  38. Date-time arguments using either of the ISO 8601 formats must have a time zone
  39. designator, where Z is accepted as an abbreviation for UTC time.
  40. NOTE: When a URL is expected (for example, in browsers), the `+` used in time
  41. zone designators must be encoded as `%2B`.
  42. If the system restarts, any jobs that had {dfeeds} running are also restarted.
  43. When a stopped {dfeed} is restarted, it continues processing input data from
  44. the next millisecond after it was stopped. If new data was indexed for that
  45. exact millisecond between stopping and starting, it will be ignored.
  46. If you specify a `start` value that is earlier than the timestamp of the latest
  47. processed record, the {dfeed} continues from 1 millisecond after the timestamp
  48. of the latest processed record.
  49. IMPORTANT: When {es} {security-features} are enabled, your {dfeed} remembers
  50. which roles the last user to create or update it had at the time of
  51. creation/update and runs the query using those same roles. If you provided
  52. <<http-clients-secondary-authorization,secondary authorization headers>> when
  53. you created or updated the {dfeed}, those credentials are used instead.
  54. [[ml-start-datafeed-path-parms]]
  55. == {api-path-parms-title}
  56. `<feed_id>`::
  57. (Required, string)
  58. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=datafeed-id]
  59. [[ml-start-datafeed-query-parms]]
  60. == {api-query-parms-title}
  61. `end`::
  62. (Optional, string) The time that the {dfeed} should end. This value is
  63. exclusive. The default value is an empty string.
  64. `start`::
  65. (Optional, string) The time that the {dfeed} should begin. This value is
  66. inclusive. The default value is an empty string.
  67. `timeout`::
  68. (Optional, time) Controls the amount of time to wait until a {dfeed} starts.
  69. The default value is 20 seconds.
  70. [[ml-start-datafeed-request-body]]
  71. == {api-request-body-title}
  72. `end`::
  73. (Optional, string) The time that the {dfeed} should end. This value is
  74. exclusive. The default value is an empty string.
  75. `start`::
  76. (Optional, string) The time that the {dfeed} should begin. This value is
  77. inclusive. The default value is an empty string.
  78. `timeout`::
  79. (Optional, time) Controls the amount of time to wait until a {dfeed} starts.
  80. The default value is 20 seconds.
  81. [[ml-start-datafeed-response-body]]
  82. == {api-response-body-title}
  83. `node`::
  84. (string) The ID of the node that the {dfeed} was started on.
  85. If the {dfeed} is allowed to open lazily and has not yet been
  86. assigned to a node, this value is an empty string.
  87. `started`::
  88. (Boolean) For a successful response, this value is always `true`. On failure, an
  89. exception is returned instead.
  90. [[ml-start-datafeed-example]]
  91. == {api-examples-title}
  92. [source,console]
  93. --------------------------------------------------
  94. POST _ml/datafeeds/datafeed-low_request_rate/_start
  95. {
  96. "start": "2019-04-07T18:22:16Z"
  97. }
  98. --------------------------------------------------
  99. // TEST[skip:Kibana sample data]
  100. When the {dfeed} starts, you receive the following results:
  101. [source,console-result]
  102. ----
  103. {
  104. "started" : true,
  105. "node" : "node-1"
  106. }
  107. ----