index.asciidoc 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. ifdef::permanently-unreleased-branch[]
  2. [role="xpack"]
  3. [testenv="basic"]
  4. [[xpack-rollup]]
  5. == Rollups
  6. A rollup aggregates an index's time series data and stores the results in a new
  7. read-only index, called a rollup index. For example, you can roll up hourly
  8. metric data into daily or weekly summaries.
  9. A rollup index only contains aggregated data for the fields you choose. You can
  10. search, visualize, and aggregate a rollup index like a regular index. While its
  11. data is less granular, a rollup index contains fewer fields and documents,
  12. making these operations faster.
  13. Use rollups to:
  14. * Reduce storage costs by deleting or archiving your original indices
  15. * Speed up searches and visualizations
  16. * Compactly store historical metric data
  17. image::images/rollups/rollups.gif[Use rollups to reduce the size of your data]
  18. [discrete]
  19. [[roll-up-your-data]]
  20. === Roll up your data
  21. You typically perform rollups using the {ilm-init} <<ilm-rollup,`rollup`>>
  22. action. You configure the `rollup` action with the aggregations and metrics
  23. you want to store in the rollup index.
  24. The `rollup` action also lets you specify an {ilm-init} policy for the resulting
  25. rollup index. If you don't specify this policy, {ilm-init} will not manage the
  26. rollup index.
  27. [TIP]
  28. ====
  29. In most cases, the {ilm-init} policy for a rollup index should differ from the
  30. policy for its source index. To prevent <<size-your-shards,oversharding>>, we
  31. also recommend using the {ilm-init} <<ilm-shrink,`shrink`>> action to reduce the
  32. rollup index's primary shard count.
  33. ====
  34. You can also manually roll up an index using the <<rollup-api,rollup API>>.
  35. [discrete]
  36. [[search-rollups]]
  37. === Rollups and data streams
  38. Rollups are designed to work with the backing indices of data streams. If you
  39. roll up a backing index for a data stream, the resulting rollup index is a
  40. backing index for the same stream.
  41. If you search a data stream containing both a rollup index and its source index,
  42. {es} automatically resolves searches without duplicate results.
  43. If results from the rollup index and the source index would be the same, {es}
  44. uses the rollup for faster results. If the results differ, {es} uses the source
  45. index's data for better accuracy. If you've replaced the source index with a
  46. searchable snapshot, {es} uses the searchable snapshot as the source index.
  47. This automatic search resolution lets you use rollups as a caching layer for
  48. your data stream. You can keep rollup indices in a hot or warm <<data-tiers,data
  49. tier>> and archive your original indices in a cold or frozen tier.
  50. NOTE: Only data streams support automatic search resolution for rollups. Searches
  51. directly targeting a rollup index and its source index may return duplicate
  52. results.
  53. [discrete]
  54. [[legacy-rollups]]
  55. === Legacy rollups
  56. // tag::legacy-rollups[]
  57. Before {es} 7.x, you could only create rollups using periodic cron jobs. Special
  58. APIs were required to manage these jobs and search the resulting rollup indices.
  59. These rollup APIs are now deprecated and will be removed in a future release.
  60. // end::legacy-rollups[]
  61. See <<legacy-rollup-apis>>.
  62. [discrete]
  63. [[differences-with-legacy-rollups]]
  64. ==== Differences from legacy rollups
  65. The new rollup functionality differs from legacy rollups as follows:
  66. * Rollups no longer require a cron job. You can perform rollups using the
  67. {ilm-init} <<ilm-rollup,`rollup`>> action or <<rollup-api,rollup API>>.
  68. * Rollup indices are read-only and only contain aggregated data from one source
  69. index. Previously, multiple legacy rollup jobs could index into a single rollup
  70. index.
  71. * You can now search rollup indices like a regular index. Legacy rollup indices
  72. required a special rollup search API, which could only search one rollup index
  73. at a time.
  74. * While still approximate, `terms` aggregations for rollups are now more
  75. accurate. Previously, `terms` aggregations for legacy rollup jobs could provide
  76. inaccurate document counts due to differences between shards for the source
  77. index.
  78. endif::[]
  79. ifndef::permanently-unreleased-branch[]
  80. [role="xpack"]
  81. [testenv="basic"]
  82. [[xpack-rollup]]
  83. == Rolling up historical data
  84. experimental[]
  85. Keeping historical data around for analysis is extremely useful but often avoided due to the financial cost of
  86. archiving massive amounts of data. Retention periods are thus driven by financial realities rather than by the
  87. usefulness of extensive historical data.
  88. // tag::rollup-intro[]
  89. The {stack} {rollup-features} provide a means to summarize and store historical
  90. data so that it can still be used for analysis, but at a fraction of the storage
  91. cost of raw data.
  92. // end::rollup-intro[]
  93. * <<rollup-overview,Overview>>
  94. * <<rollup-getting-started,Getting started>>
  95. * <<rollup-api-quickref, API quick reference>>
  96. * <<rollup-understanding-groups,Understanding rollup grouping>>
  97. * <<rollup-agg-limitations,Rollup aggregation limitations>>
  98. * <<rollup-search-limitations,Rollup search limitations>>
  99. include::overview.asciidoc[]
  100. include::api-quickref.asciidoc[]
  101. include::rollup-getting-started.asciidoc[]
  102. include::understanding-groups.asciidoc[]
  103. include::rollup-agg-limitations.asciidoc[]
  104. include::rollup-search-limitations.asciidoc[]
  105. endif::[]