create-data-stream.asciidoc 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. [[indices-create-data-stream]]
  2. === Create data stream API
  3. ++++
  4. <titleabbrev>Create data stream</titleabbrev>
  5. ++++
  6. Creates a new <<data-streams,data stream>>.
  7. Data streams require an associated <<indices-templates,composable template>>.
  8. See <<set-up-a-data-stream>>.
  9. ////
  10. [source,console]
  11. ----
  12. PUT /_index_template/template
  13. {
  14. "index_patterns": ["my-data-stream*"],
  15. "template": {
  16. "mappings": {
  17. "properties": {
  18. "@timestamp": {
  19. "type": "date"
  20. }
  21. }
  22. }
  23. },
  24. "data_stream": {
  25. "timestamp_field": "@timestamp"
  26. }
  27. }
  28. ----
  29. ////
  30. [source,console]
  31. ----
  32. PUT /_data_stream/my-data-stream
  33. ----
  34. // TEST[continued]
  35. ////
  36. [source,console]
  37. -----------------------------------
  38. DELETE /_data_stream/my-data-stream
  39. DELETE /_index_template/template
  40. -----------------------------------
  41. // TEST[continued]
  42. ////
  43. [[indices-create-data-stream-request]]
  44. ==== {api-request-title}
  45. `PUT /_data_stream/<data-stream>`
  46. [[indices-create-data-stream-api-path-params]]
  47. ==== {api-path-parms-title}
  48. `<data-stream>`::
  49. +
  50. --
  51. (Required, string) Name of the data stream to create.
  52. Data stream names must meet the following criteria:
  53. - Lowercase only
  54. - Cannot include `\`, `/`, `*`, `?`, `"`, `<`, `>`, `|`, ` ` (space character),
  55. `,`, `#`, `:`
  56. - Cannot start with `-`, `_`, `+`, `.`
  57. - Cannot be `.` or `..`
  58. - Cannot be longer than 255 bytes (note it is bytes, so multi-byte characters
  59. will count towards the 255 limit faster)
  60. --