update-transform.asciidoc 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291
  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 data consistency in
  30. 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 retention policy
  78. `retention_policy`::
  79. (Optional, object)
  80. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=transform-retention]
  81. +
  82. .Properties of `retention_policy`
  83. [%collapsible%open]
  84. ====
  85. `time`:::
  86. (Required, object)
  87. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=transform-retention-time]
  88. +
  89. .Properties of `time`
  90. [%collapsible%open]
  91. =====
  92. `field`:::
  93. (Required, string)
  94. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=transform-retention-time-field]
  95. `max_age`:::
  96. (Required, <<time-units, time units>>)
  97. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=transform-retention-time-max-age]
  98. =====
  99. ====
  100. //End retention policy
  101. //Begin settings
  102. `settings`::
  103. (Optional, object)
  104. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=transform-settings]
  105. +
  106. .Properties of `settings`
  107. [%collapsible%open]
  108. ====
  109. `dates_as_epoch_millis`:::
  110. (Optional, boolean)
  111. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=transform-settings-dates-as-epoch-milli]
  112. `docs_per_second`:::
  113. (Optional, float)
  114. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=transform-settings-docs-per-second]
  115. `max_page_search_size`:::
  116. (Optional, integer)
  117. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=transform-settings-max-page-search-size]
  118. ====
  119. //End settings
  120. //Begin source
  121. `source`::
  122. (Optional, object)
  123. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=source-transforms]
  124. +
  125. .Properties of `source`
  126. [%collapsible%open]
  127. ====
  128. `index`:::
  129. (Required, string or array)
  130. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=source-index-transforms]
  131. `query`:::
  132. (Optional, object)
  133. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=source-query-transforms]
  134. ====
  135. //End source
  136. //Begin sync
  137. `sync`::
  138. (Optional, object)
  139. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=sync]
  140. +
  141. .Properties of `sync`
  142. [%collapsible%open]
  143. ====
  144. //Begin sync.time
  145. `time`:::
  146. (Required, object)
  147. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=sync-time]
  148. +
  149. .Properties of `time`
  150. [%collapsible%open]
  151. =====
  152. `delay`::::
  153. (Optional, <<time-units, time units>>)
  154. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=sync-time-delay]
  155. `field`::::
  156. (Required, string)
  157. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=sync-time-field]
  158. +
  159. --
  160. TIP: In general, it’s a good idea to use a field that contains the
  161. <<access-ingest-metadata,ingest timestamp>>. If you use a different field,
  162. you might need to set the `delay` such that it accounts for data transmission
  163. delays.
  164. --
  165. =====
  166. //End sync.time
  167. ====
  168. //End sync
  169. [[update-transform-example]]
  170. == {api-examples-title}
  171. [source,console]
  172. --------------------------------------------------
  173. POST _transform/simple-kibana-ecomm-pivot/_update
  174. {
  175. "source": {
  176. "index": "kibana_sample_data_ecommerce",
  177. "query": {
  178. "term": {
  179. "geoip.continent_name": {
  180. "value": "Asia"
  181. }
  182. }
  183. }
  184. },
  185. "description": "Maximum priced ecommerce data by customer_id in Asia",
  186. "dest": {
  187. "index": "kibana_sample_data_ecommerce_transform_v2",
  188. "pipeline": "add_timestamp_pipeline"
  189. },
  190. "frequency": "15m",
  191. "sync": {
  192. "time": {
  193. "field": "order_date",
  194. "delay": "120s"
  195. }
  196. }
  197. }
  198. --------------------------------------------------
  199. // TEST[setup:simple_kibana_continuous_pivot]
  200. When the {transform} is updated, you receive the updated configuration:
  201. [source,console-result]
  202. ----
  203. {
  204. "id": "simple-kibana-ecomm-pivot",
  205. "source": {
  206. "index": ["kibana_sample_data_ecommerce"],
  207. "query": {
  208. "term": {
  209. "geoip.continent_name": {
  210. "value": "Asia"
  211. }
  212. }
  213. }
  214. },
  215. "pivot": {
  216. "group_by": {
  217. "customer_id": {
  218. "terms": {
  219. "field": "customer_id"
  220. }
  221. }
  222. },
  223. "aggregations": {
  224. "max_price": {
  225. "max": {
  226. "field": "taxful_total_price"
  227. }
  228. }
  229. }
  230. },
  231. "description": "Maximum priced ecommerce data by customer_id in Asia",
  232. "dest": {
  233. "index": "kibana_sample_data_ecommerce_transform_v2",
  234. "pipeline": "add_timestamp_pipeline"
  235. },
  236. "frequency": "15m",
  237. "sync": {
  238. "time": {
  239. "field": "order_date",
  240. "delay": "120s"
  241. }
  242. },
  243. "settings": { },
  244. "version": "7.5.0",
  245. "create_time": 1518808660505
  246. }
  247. ----
  248. // TESTRESPONSE[s/"version": "7.5.0"/"version": $body.version/]
  249. // TESTRESPONSE[s/"create_time": 1518808660505/"create_time": $body.create_time/]