create-data-stream.asciidoc 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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-api-path-params]]
  37. ==== {api-path-parms-title}
  38. `<data-stream>`::
  39. +
  40. --
  41. (Required, string) Name of the data stream to create.
  42. // tag::data-stream-name[]
  43. Data stream names must meet the following criteria:
  44. - Lowercase only
  45. - Cannot include `\`, `/`, `*`, `?`, `"`, `<`, `>`, `|`, `,`, `#`, `:`, or a
  46. space character
  47. - Cannot start with `-`, `_`, `+`, or `.ds-`
  48. - Cannot be `.` or `..`
  49. - Cannot be longer than 255 bytes. Multi-byte characters
  50. count towards this limit faster.
  51. // end::data-stream-name[]
  52. --