data-streams.asciidoc 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. [[data-streams]]
  2. = Data streams
  3. [partintro]
  4. --
  5. You can use data streams to index time-based data that's continuously generated.
  6. A data stream groups indices from the same time-based data source.
  7. A data stream tracks its indices, known as _backing indices_, using an ordered
  8. list.
  9. A data stream's backing indices are <<index-hidden,hidden>>.
  10. While all backing indices handle read requests, the most recently created
  11. backing index is the data stream's only write index. A data stream only
  12. accepts <<docs-index_,index requests>> with `op_type` set to `create`. To update
  13. or delete specific documents in a data stream, submit a <<docs-delete,delete>>
  14. or <<docs-update,update>> API request to the backing index containing the
  15. document.
  16. To create a data stream, set up a <<indices-templates,composable index
  17. template>> containing:
  18. * A name or wildcard pattern for the data stream in the `index_patterns` property.
  19. * A `data_stream` definition that contains the `timestamp_field` property.
  20. The `timestamp_field` must be the primary timestamp field
  21. for the data source. This field must be included in every
  22. document indexed to the data stream.
  23. When you index one or more documents to a not-yet-existent target matching
  24. the template's name or pattern, {es} automatically creates the corresponding
  25. data stream. You can also manually create a data stream using the
  26. <<indices-create-data-stream,create data stream API>>. However, a composable
  27. template for the stream is still required.
  28. You can use the <<indices-rollover-index,rollover API>> to roll a data stream
  29. over to a new index when the current write index meets specified criteria, such
  30. as a maximum age or size. A rollover creates a new backing index and updates the
  31. data stream's list of backing indices. This new index then becomes the stream's
  32. new write index. See <<rollover-data-stream-ex>>.
  33. Backing indices are generated with the naming convention
  34. `.ds-<data-stream-name>-zzzzzz`, where `zzzzzz` is the six-digit, zero-padded
  35. generation of the data stream. For example, a data stream named
  36. `web-server-logs` with a generation of 34 would have a write index named
  37. `.ds-web-server-logs-000034`. Data streams may have backing indices that do not
  38. conform to this naming convention if operations such as
  39. <<indices-shrink-index,shrink>> have been performed on them.
  40. [discrete]
  41. [[data-streams-apis]]
  42. == Data stream APIs
  43. The following APIs are available for managing data streams:
  44. * To get information about data streams, use the <<indices-get-data-stream, get data stream API>>.
  45. * To delete data streams, use the <<indices-delete-data-stream, delete data stream API>>.
  46. * To manually create a data stream, use the <<indices-create-data-stream, create data stream API>>.
  47. [discrete]
  48. [[data-streams-toc]]
  49. == In this section
  50. * <<set-up-a-data-stream>>
  51. * <<use-a-data-stream>>
  52. --
  53. include::set-up-a-data-stream.asciidoc[]
  54. include::use-a-data-stream.asciidoc[]