start-datafeed.asciidoc 4.2 KB

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