start-datafeed.asciidoc 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  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. A {dfeed} must be started in order to retrieve data from {es}.
  11. A {dfeed} can be started and stopped multiple times throughout its lifecycle.
  12. ==== Request
  13. `POST _ml/datafeeds/<feed_id>/_start`
  14. ==== Description
  15. NOTE: Before you can start a {dfeed}, the job must be open. Otherwise, an error
  16. occurs.
  17. When you start a {dfeed}, you can specify a start time. This enables you to
  18. include a training period, providing you have this data available in {es}.
  19. If you want to analyze from the beginning of a dataset, you can specify any date
  20. earlier than that beginning date.
  21. If you do not specify a start time and the {dfeed} is associated with a new
  22. job, the analysis starts from the earliest time for which data is available.
  23. When you start a {dfeed}, you can also specify an end time. If you do so, the
  24. job analyzes data from the start time until the end time, at which point the
  25. analysis stops. This scenario is useful for a one-off batch analysis. If you
  26. do not specify an end time, the {dfeed} runs continuously.
  27. The `start` and `end` times can be specified by using one of the
  28. following formats: +
  29. - ISO 8601 format with milliseconds, for example `2017-01-22T06:00:00.000Z`
  30. - ISO 8601 format without milliseconds, for example `2017-01-22T06:00:00+00:00`
  31. - Seconds from the Epoch, for example `1390370400`
  32. Date-time arguments using either of the ISO 8601 formats must have a time zone
  33. designator, where Z is accepted as an abbreviation for UTC time.
  34. NOTE: When a URL is expected (for example, in browsers), the `+` used in time
  35. zone designators must be encoded as `%2B`.
  36. If the system restarts, any jobs that had {dfeeds} running are also restarted.
  37. When a stopped {dfeed} is restarted, it continues processing input data from
  38. the next millisecond after it was stopped. If new data was indexed for that
  39. exact millisecond between stopping and starting, it will be ignored.
  40. If you specify a `start` value that is earlier than the timestamp of the latest
  41. processed record, the {dfeed} continues from 1 millisecond after the timestamp
  42. of the latest processed record.
  43. ==== Path Parameters
  44. `feed_id` (required)::
  45. (string) Identifier for the {dfeed}
  46. ==== Request Body
  47. `end`::
  48. (string) The time that the {dfeed} should end. This value is exclusive.
  49. The default value is an empty string.
  50. `start`::
  51. (string) The time that the {dfeed} should begin. This value is inclusive.
  52. The default value is an empty string.
  53. `timeout`::
  54. (time) Controls the amount of time to wait until a {dfeed} starts.
  55. The default value is 20 seconds.
  56. ==== Authorization
  57. If {es} {security-features} are enabled, you must have `manage_ml`, or `manage`
  58. cluster privileges to use this API. For more information, see
  59. {stack-ov}/security-privileges.html[Security Privileges].
  60. ==== Security integration
  61. When {es} {security-features} are enabled, your {dfeed} remembers which roles the
  62. last user to create or update it had at the time of creation/update and runs the
  63. query using those same roles.
  64. ==== Examples
  65. The following example starts the `datafeed-it-ops-kpi` {dfeed}:
  66. [source,js]
  67. --------------------------------------------------
  68. POST _ml/datafeeds/datafeed-total-requests/_start
  69. {
  70. "start": "2017-04-07T18:22:16Z"
  71. }
  72. --------------------------------------------------
  73. // CONSOLE
  74. // TEST[skip:setup:server_metrics_openjob]
  75. When the {dfeed} starts, you receive the following results:
  76. [source,js]
  77. ----
  78. {
  79. "started": true
  80. }
  81. ----
  82. // TESTRESPONSE