start-datafeed.asciidoc 4.3 KB

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