create-data-stream.asciidoc 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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 <<indices-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. "template": {
  17. "mappings": {
  18. "properties": {
  19. "@timestamp": {
  20. "type": "date"
  21. }
  22. }
  23. }
  24. },
  25. "data_stream": {}
  26. }
  27. ----
  28. ////
  29. [source,console]
  30. ----
  31. PUT /_data_stream/my-data-stream
  32. ----
  33. // TEST[continued]
  34. ////
  35. [source,console]
  36. -----------------------------------
  37. DELETE /_data_stream/my-data-stream
  38. DELETE /_index_template/template
  39. -----------------------------------
  40. // TEST[continued]
  41. ////
  42. [[indices-create-data-stream-request]]
  43. ==== {api-request-title}
  44. `PUT /_data_stream/<data-stream>`
  45. [[indices-create-data-stream-api-path-params]]
  46. ==== {api-path-parms-title}
  47. `<data-stream>`::
  48. +
  49. --
  50. (Required, string) Name of the data stream to create.
  51. Data stream names must meet the following criteria:
  52. - Lowercase only
  53. - Cannot include `\`, `/`, `*`, `?`, `"`, `<`, `>`, `|`, ` ` (space character),
  54. `,`, `#`, `:`
  55. - Cannot start with `-`, `_`, `+`, `.`
  56. - Cannot be `.` or `..`
  57. - Cannot be longer than 255 bytes (note it is bytes, so multi-byte characters
  58. will count towards the 255 limit faster)
  59. --