overview.asciidoc 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. [role="xpack"]
  2. [[transform-overview]]
  3. = {transform-cap} overview
  4. ++++
  5. <titleabbrev>Overview</titleabbrev>
  6. ++++
  7. You can choose either of the following methods to transform your data:
  8. <<pivot-transform-overview,pivot>> or <<latest-transform-overview,latest>>.
  9. IMPORTANT: All {transforms} leave your source index intact. They create a new
  10. index that is dedicated to the transformed data.
  11. [[pivot-transform-overview]]
  12. == Pivot {transforms}
  13. You can use {transforms} to _pivot_ your data into a new entity-centric index.
  14. By transforming and summarizing your data, it becomes possible to visualize and
  15. analyze it in alternative and interesting ways.
  16. A lot of {es} indices are organized as a stream of events: each event is an
  17. individual document, for example a single item purchase. {transforms-cap} enable
  18. you to summarize this data, bringing it into an organized, more
  19. analysis-friendly format. For example, you can summarize all the purchases of a
  20. single customer.
  21. {transforms-cap} enable you to define a pivot, which is a set of
  22. features that transform the index into a different, more digestible format.
  23. Pivoting results in a summary of your data in a new index.
  24. To define a pivot, first you select one or more fields that you will use to
  25. group your data. You can select categorical fields (terms) and numerical fields
  26. for grouping. If you use numerical fields, the field values are bucketed using
  27. an interval that you specify.
  28. The second step is deciding how you want to aggregate the grouped data. When
  29. using aggregations, you practically ask questions about the index. There are
  30. different types of aggregations, each with its own purpose and output. To learn
  31. more about the supported aggregations and group-by fields, see
  32. <<put-transform>>.
  33. As an optional step, you can also add a query to further limit the scope of the
  34. aggregation.
  35. The {transform} performs a composite aggregation that paginates through all the
  36. data defined by the source index query. The output of the aggregation is stored
  37. in a _destination index_. Each time the {transform} queries the source index, it
  38. creates a _checkpoint_. You can decide whether you want the {transform} to run
  39. once or continuously. A _batch {transform}_ is a single operation that has a
  40. single checkpoint. _{ctransforms-cap}_ continually increment and process
  41. checkpoints as new source data is ingested.
  42. Imagine that you run a webshop that sells clothes. Every order creates a
  43. document that contains a unique order ID, the name and the category of the
  44. ordered product, its price, the ordered quantity, the exact date of the order,
  45. and some customer information (name, gender, location, etc). Your data set
  46. contains all the transactions from last year.
  47. If you want to check the sales in the different categories in your last fiscal
  48. year, define a {transform} that groups the data by the product categories
  49. (women's shoes, men's clothing, etc.) and the order date. Use the last year as
  50. the interval for the order date. Then add a sum aggregation on the ordered
  51. quantity. The result is an entity-centric index that shows the number of sold
  52. items in every product category in the last year.
  53. [role="screenshot"]
  54. image::images/pivot-preview.png["Example of a pivot {transform} preview in {kib}"]
  55. [[latest-transform-overview]]
  56. == Latest {transforms}
  57. beta::[]
  58. You can use the `latest` type of {transform} to copy the most recent documents
  59. into a new index. You must identify one or more fields as the unique key for
  60. grouping your data, as well as a date field that sorts the data chronologically.
  61. For example, you can use this type of {transform} to keep track of the latest
  62. purchase for each customer or the latest event for each host.
  63. [role="screenshot"]
  64. image::images/latest-preview.png["Example of a latest {transform} preview in {kib}"]
  65. As in the case of a pivot, a latest {transform} can run once or continuously. It
  66. performs a composite aggregation on the data in the source index and stores the
  67. output in the destination index. If the {transform} runs continuously, new unique
  68. key values are automatically added to the destination index and the most recent
  69. documents for existing key values are automatically updated at each checkpoint.
  70. [[transform-performance]]
  71. == Performance considerations
  72. {transforms-cap} perform search aggregations on the source indices then index
  73. the results into the destination index. Therefore, a {transform} never takes
  74. less time or uses less resources than the aggregation and indexing processes.
  75. If your {transform} must process a lot of historic data, it has high resource
  76. usage initially--particularly during the first checkpoint.
  77. For better performance, make sure that your search aggregations and queries are
  78. optimized and that your {transform} is processing only necessary data. Consider
  79. whether you can apply a source query to the {transform} to reduce the scope of
  80. data it processes. Also consider whether the cluster has sufficient resources in
  81. place to support both the composite aggregation search and the indexing of its
  82. results.
  83. If you prefer to spread out the impact on your cluster (at the cost of a slower
  84. {transform}), you can throttle the rate at which it performs search and index
  85. requests. Set the `docs_per_second` limit when you <<put-transform,create>> or
  86. <<update-transform,update>> your {transform}. If you want to calculate the
  87. current rate, use the following information from the
  88. {ref}/get-transform-stats.html[get {transform} stats API]:
  89. ```
  90. documents_processed / search_time_in_ms * 1000
  91. ```