1
0

create-data-stream.asciidoc 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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. Data streams require a matching <<index-templates,index template>>.
  9. See <<set-up-a-data-stream>>.
  10. ////
  11. [source,console]
  12. ----
  13. PUT /_index_template/template
  14. {
  15. "index_patterns": ["my-data-stream*"],
  16. "data_stream": { }
  17. }
  18. ----
  19. ////
  20. [source,console]
  21. ----
  22. PUT /_data_stream/my-data-stream
  23. ----
  24. // TEST[continued]
  25. ////
  26. [source,console]
  27. -----------------------------------
  28. DELETE /_data_stream/my-data-stream
  29. DELETE /_index_template/template
  30. -----------------------------------
  31. // TEST[continued]
  32. ////
  33. [[indices-create-data-stream-request]]
  34. ==== {api-request-title}
  35. `PUT /_data_stream/<data-stream>`
  36. [[indices-create-data-stream-prereqs]]
  37. ==== {api-prereq-title}
  38. * If the {es} {security-features} are enabled, you must have the `create_index`
  39. or `manage` <<privileges-list-indices,index privilege>> for the 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.
  46. // tag::data-stream-name[]
  47. Data stream names must meet the following criteria:
  48. - Lowercase only
  49. - Cannot include `\`, `/`, `*`, `?`, `"`, `<`, `>`, `|`, `,`, `#`, `:`, or a
  50. space character
  51. - Cannot start with `-`, `_`, `+`, or `.ds-`
  52. - Cannot be `.` or `..`
  53. - Cannot be longer than 255 bytes. Multi-byte characters
  54. count towards this limit faster.
  55. // end::data-stream-name[]
  56. --