update-transform.asciidoc 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262
  1. [role="xpack"]
  2. [testenv="basic"]
  3. [[update-transform]]
  4. = Update {transform} API
  5. [subs="attributes"]
  6. ++++
  7. <titleabbrev>Update {transform}</titleabbrev>
  8. ++++
  9. Updates certain properties of a {transform}.
  10. [[update-transform-request]]
  11. == {api-request-title}
  12. `POST _transform/<transform_id>/_update`
  13. [[update-transform-prereqs]]
  14. == {api-prereq-title}
  15. If the {es} {security-features} are enabled, you must have the following
  16. built-in roles and privileges:
  17. * `transform_admin`
  18. * `manage_transform` (the built-in `transform_admin` role has this privilege)
  19. * source index: `read`, `view_index_metadata`
  20. * destination index: `read`, `create_index`, `index`
  21. For more information, see <<security-privileges>> and <<built-in-roles>>.
  22. [[update-transform-desc]]
  23. == {api-description-title}
  24. This API updates an existing {transform}. The list of properties that you can
  25. update is a subset of the list that you can define when you create a {transform}.
  26. When the {transform} is updated, a series of validations occur to ensure its
  27. success. You can use the `defer_validation` parameter to skip these checks.
  28. All updated properties except description do not take effect until after the
  29. {transform} starts the next checkpoint. This is so there is consistency with the
  30. pivoted data in each checkpoint.
  31. [IMPORTANT]
  32. ====
  33. * When {es} {security-features} are enabled, your {transform} remembers which
  34. roles the user who updated it had at the time of update and runs with those
  35. privileges.
  36. * You must use {kib} or this API to update a {transform}. Do not update a
  37. {transform} directly via `.transform-internal*` indices using the {es} index API.
  38. If {es} {security-features} are enabled, do not give users any privileges on
  39. `.transform-internal*` indices. If you used {transforms} prior 7.5, also do not
  40. give users any privileges on `.data-frame-internal*` indices.
  41. ====
  42. [[update-transform-path-parms]]
  43. == {api-path-parms-title}
  44. `<transform_id>`::
  45. (Required, string)
  46. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=transform-id]
  47. [[update-transform-query-parms]]
  48. == {api-query-parms-title}
  49. `defer_validation`::
  50. (Optional, boolean) When `true`, deferrable validations are not run. This
  51. behavior may be desired if the source index does not exist until after the
  52. {transform} is updated.
  53. [role="child_attributes"]
  54. [[update-transform-request-body]]
  55. == {api-request-body-title}
  56. `description`::
  57. (Optional, string) Free text description of the {transform}.
  58. //Begin dest
  59. `dest`::
  60. (Optional, object)
  61. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=dest]
  62. +
  63. .Properties of `dest`
  64. [%collapsible%open]
  65. ====
  66. `index`:::
  67. (Required, string)
  68. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=dest-index]
  69. `pipeline`:::
  70. (Optional, string)
  71. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=dest-pipeline]
  72. ====
  73. //End dest
  74. `frequency`::
  75. (Optional, <<time-units, time units>>)
  76. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=frequency]
  77. //Begin settings
  78. `settings`::
  79. (Optional, object)
  80. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=transform-settings]
  81. +
  82. .Properties of `settings`
  83. [%collapsible%open]
  84. ====
  85. `docs_per_second`:::
  86. (Optional, float)
  87. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=transform-settings-docs-per-second]
  88. `max_page_search_size`:::
  89. (Optional, integer)
  90. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=transform-settings-max-page-search-size]
  91. ====
  92. //End settings
  93. //Begin source
  94. `source`::
  95. (Optional, object)
  96. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=source-transforms]
  97. +
  98. .Properties of `source`
  99. [%collapsible%open]
  100. ====
  101. `index`:::
  102. (Required, string or array)
  103. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=source-index-transforms]
  104. `query`:::
  105. (Optional, object)
  106. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=source-query-transforms]
  107. ====
  108. //End source
  109. //Begin sync
  110. `sync`::
  111. (Optional, object)
  112. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=sync]
  113. +
  114. .Properties of `sync`
  115. [%collapsible%open]
  116. ====
  117. //Begin sync.time
  118. `time`:::
  119. (Required, object)
  120. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=sync-time]
  121. +
  122. .Properties of `time`
  123. [%collapsible%open]
  124. =====
  125. `delay`::::
  126. (Optional, <<time-units, time units>>)
  127. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=sync-time-delay]
  128. `field`::::
  129. (Required, string)
  130. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=sync-time-field]
  131. +
  132. --
  133. TIP: In general, it’s a good idea to use a field that contains the
  134. <<accessing-ingest-metadata,ingest timestamp>>. If you use a different field,
  135. you might need to set the `delay` such that it accounts for data transmission
  136. delays.
  137. --
  138. =====
  139. //End sync.time
  140. ====
  141. //End sync
  142. [[update-transform-example]]
  143. == {api-examples-title}
  144. [source,console]
  145. --------------------------------------------------
  146. POST _transform/simple-kibana-ecomm-pivot/_update
  147. {
  148. "source": {
  149. "index": "kibana_sample_data_ecommerce",
  150. "query": {
  151. "term": {
  152. "geoip.continent_name": {
  153. "value": "Asia"
  154. }
  155. }
  156. }
  157. },
  158. "description": "Maximum priced ecommerce data by customer_id in Asia",
  159. "dest": {
  160. "index": "kibana_sample_data_ecommerce_transform_v2",
  161. "pipeline": "add_timestamp_pipeline"
  162. },
  163. "frequency": "15m",
  164. "sync": {
  165. "time": {
  166. "field": "order_date",
  167. "delay": "120s"
  168. }
  169. }
  170. }
  171. --------------------------------------------------
  172. // TEST[setup:simple_kibana_continuous_pivot]
  173. When the {transform} is updated, you receive the updated configuration:
  174. [source,console-result]
  175. ----
  176. {
  177. "id": "simple-kibana-ecomm-pivot",
  178. "source": {
  179. "index": ["kibana_sample_data_ecommerce"],
  180. "query": {
  181. "term": {
  182. "geoip.continent_name": {
  183. "value": "Asia"
  184. }
  185. }
  186. }
  187. },
  188. "pivot": {
  189. "group_by": {
  190. "customer_id": {
  191. "terms": {
  192. "field": "customer_id"
  193. }
  194. }
  195. },
  196. "aggregations": {
  197. "max_price": {
  198. "max": {
  199. "field": "taxful_total_price"
  200. }
  201. }
  202. }
  203. },
  204. "description": "Maximum priced ecommerce data by customer_id in Asia",
  205. "dest": {
  206. "index": "kibana_sample_data_ecommerce_transform_v2",
  207. "pipeline": "add_timestamp_pipeline"
  208. },
  209. "frequency": "15m",
  210. "sync": {
  211. "time": {
  212. "field": "order_date",
  213. "delay": "120s"
  214. }
  215. },
  216. "settings": { },
  217. "version": "7.5.0",
  218. "create_time": 1518808660505
  219. }
  220. ----
  221. // TESTRESPONSE[s/"version": "7.5.0"/"version": $body.version/]
  222. // TESTRESPONSE[s/"create_time": 1518808660505/"create_time": $body.create_time/]