update-transform.asciidoc 7.5 KB

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