create-data-stream.asciidoc 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. [role="xpack"]
  2. [[indices-create-data-stream]]
  3. === Create data stream API
  4. ++++
  5. <titleabbrev>Create data stream</titleabbrev>
  6. ++++
  7. Creates a new <<data-streams,data stream>>.
  8. ////
  9. [source,console]
  10. ----
  11. PUT /_index_template/template
  12. {
  13. "index_patterns": ["my-data-stream*"],
  14. "data_stream": { }
  15. }
  16. ----
  17. ////
  18. [source,console]
  19. ----
  20. PUT /_data_stream/my-data-stream
  21. ----
  22. // TEST[continued]
  23. ////
  24. [source,console]
  25. -----------------------------------
  26. DELETE /_data_stream/my-data-stream
  27. DELETE /_index_template/template
  28. -----------------------------------
  29. // TEST[continued]
  30. ////
  31. [[indices-create-data-stream-request]]
  32. ==== {api-request-title}
  33. `PUT /_data_stream/<data-stream>`
  34. [[indices-create-data-stream-prereqs]]
  35. ==== {api-prereq-title}
  36. * If the {es} {security-features} are enabled, you must have the `create_index`
  37. or `manage` <<privileges-list-indices,index privilege>> for the data stream.
  38. * A matching <<index-templates,index template>> with data stream enabled.
  39. See <<set-up-a-data-stream>>.
  40. [[indices-create-data-stream-api-path-params]]
  41. ==== {api-path-parms-title}
  42. `<data-stream>`::
  43. +
  44. --
  45. (Required, string) Name of the data stream to create. Data stream names must
  46. meet the following criteria:
  47. - Lowercase only
  48. - Cannot include `\`, `/`, `*`, `?`, `"`, `<`, `>`, `|`, `,`, `#`, `:`, or a
  49. space character
  50. - Cannot start with `-`, `_`, `+`, or `.ds-`
  51. - Cannot be `.` or `..`
  52. - Cannot be longer than 255 bytes. Multi-byte characters
  53. count towards this limit faster.
  54. --