1
0

update-transform.asciidoc 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313
  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`. If a `retention_policy` is configured, `delete` index privilege is
  19. also required.
  20. [[update-transform-desc]]
  21. == {api-description-title}
  22. This API updates an existing {transform}. The list of properties that you can
  23. update is a subset of the list that you can define when you create a {transform}.
  24. When the {transform} is updated, a series of validations occur to ensure its
  25. success. You can use the `defer_validation` parameter to skip these checks.
  26. All updated properties except description do not take effect until after the
  27. {transform} starts the next checkpoint. This is so there is data consistency in
  28. each checkpoint.
  29. [IMPORTANT]
  30. ====
  31. * When {es} {security-features} are enabled, your {transform} remembers which
  32. roles the user who updated it had at the time of update and runs with those
  33. privileges. If you provide
  34. <<http-clients-secondary-authorization,secondary authorization headers>>, those
  35. credentials are used instead.
  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. `timeout`::
  54. (Optional, time)
  55. Period to wait for a response. If no response is received before the timeout
  56. expires, the request fails and returns an error. Defaults to `30s`.
  57. [role="child_attributes"]
  58. [[update-transform-request-body]]
  59. == {api-request-body-title}
  60. `description`::
  61. (Optional, string) Free text description of the {transform}.
  62. //Begin dest
  63. `dest`::
  64. (Optional, object)
  65. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=dest]
  66. +
  67. .Properties of `dest`
  68. [%collapsible%open]
  69. ====
  70. `index`:::
  71. (Required, string)
  72. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=dest-index]
  73. `pipeline`:::
  74. (Optional, string)
  75. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=dest-pipeline]
  76. ====
  77. //End dest
  78. `frequency`::
  79. (Optional, <<time-units, time units>>)
  80. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=frequency]
  81. //Begin _meta
  82. `_meta`::
  83. (Optional, object)
  84. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=transform-metadata]
  85. //End _meta
  86. //Begin retention policy
  87. `retention_policy`::
  88. (Optional, object)
  89. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=transform-retention]
  90. +
  91. .Properties of `retention_policy`
  92. [%collapsible%open]
  93. ====
  94. `time`:::
  95. (Required, object)
  96. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=transform-retention-time]
  97. +
  98. .Properties of `time`
  99. [%collapsible%open]
  100. =====
  101. `field`:::
  102. (Required, string)
  103. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=transform-retention-time-field]
  104. `max_age`:::
  105. (Required, <<time-units, time units>>)
  106. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=transform-retention-time-max-age]
  107. =====
  108. ====
  109. //End retention policy
  110. //Begin settings
  111. `settings`::
  112. (Optional, object)
  113. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=transform-settings]
  114. +
  115. .Properties of `settings`
  116. [%collapsible%open]
  117. ====
  118. `dates_as_epoch_millis`:::
  119. (Optional, boolean)
  120. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=transform-settings-dates-as-epoch-milli]
  121. `docs_per_second`:::
  122. (Optional, float)
  123. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=transform-settings-docs-per-second]
  124. `align_checkpoints`:::
  125. (Optional, boolean)
  126. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=transform-settings-align-checkpoints]
  127. `deduce_mappings`:::
  128. (Optional, boolean)
  129. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=transform-settings-deduce-mappings]
  130. `max_page_search_size`:::
  131. (Optional, integer)
  132. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=transform-settings-max-page-search-size]
  133. ====
  134. //End settings
  135. //Begin source
  136. `source`::
  137. (Optional, object)
  138. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=source-transforms]
  139. +
  140. .Properties of `source`
  141. [%collapsible%open]
  142. ====
  143. `index`:::
  144. (Required, string or array)
  145. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=source-index-transforms]
  146. `query`:::
  147. (Optional, object)
  148. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=source-query-transforms]
  149. ====
  150. //End source
  151. //Begin sync
  152. `sync`::
  153. (Optional, object)
  154. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=sync]
  155. +
  156. --
  157. NOTE: You can update these properties only if it is a continuous {transform}. You
  158. cannot change a batch {transform} into a continuous {transform} or vice versa.
  159. Instead, clone the {transform} in {kib} and add or remove the `sync` property.
  160. --
  161. +
  162. .Properties of `sync`
  163. [%collapsible%open]
  164. ====
  165. //Begin sync.time
  166. `time`:::
  167. (Required, object)
  168. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=sync-time]
  169. +
  170. .Properties of `time`
  171. [%collapsible%open]
  172. =====
  173. `delay`::::
  174. (Optional, <<time-units, time units>>)
  175. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=sync-time-delay]
  176. `field`::::
  177. (Required, string)
  178. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=sync-time-field]
  179. +
  180. --
  181. TIP: In general, it’s a good idea to use a field that contains the
  182. <<access-ingest-metadata,ingest timestamp>>. If you use a different field,
  183. you might need to set the `delay` such that it accounts for data transmission
  184. delays.
  185. --
  186. =====
  187. //End sync.time
  188. ====
  189. //End sync
  190. [[update-transform-example]]
  191. == {api-examples-title}
  192. [source,console]
  193. --------------------------------------------------
  194. POST _transform/simple-kibana-ecomm-pivot/_update
  195. {
  196. "source": {
  197. "index": "kibana_sample_data_ecommerce",
  198. "query": {
  199. "term": {
  200. "geoip.continent_name": {
  201. "value": "Asia"
  202. }
  203. }
  204. }
  205. },
  206. "description": "Maximum priced ecommerce data by customer_id in Asia",
  207. "dest": {
  208. "index": "kibana_sample_data_ecommerce_transform_v2",
  209. "pipeline": "add_timestamp_pipeline"
  210. },
  211. "frequency": "15m",
  212. "sync": {
  213. "time": {
  214. "field": "order_date",
  215. "delay": "120s"
  216. }
  217. }
  218. }
  219. --------------------------------------------------
  220. // TEST[setup:simple_kibana_continuous_pivot]
  221. When the {transform} is updated, you receive the updated configuration:
  222. [source,console-result]
  223. ----
  224. {
  225. "id": "simple-kibana-ecomm-pivot",
  226. "source": {
  227. "index": ["kibana_sample_data_ecommerce"],
  228. "query": {
  229. "term": {
  230. "geoip.continent_name": {
  231. "value": "Asia"
  232. }
  233. }
  234. }
  235. },
  236. "pivot": {
  237. "group_by": {
  238. "customer_id": {
  239. "terms": {
  240. "field": "customer_id"
  241. }
  242. }
  243. },
  244. "aggregations": {
  245. "max_price": {
  246. "max": {
  247. "field": "taxful_total_price"
  248. }
  249. }
  250. }
  251. },
  252. "description": "Maximum priced ecommerce data by customer_id in Asia",
  253. "dest": {
  254. "index": "kibana_sample_data_ecommerce_transform_v2",
  255. "pipeline": "add_timestamp_pipeline"
  256. },
  257. "frequency": "15m",
  258. "sync": {
  259. "time": {
  260. "field": "order_date",
  261. "delay": "120s"
  262. }
  263. },
  264. "settings": { },
  265. "version": "7.5.0",
  266. "create_time": 1518808660505
  267. }
  268. ----
  269. // TESTRESPONSE[s/"version": "7.5.0"/"version": $body.version/]
  270. // TESTRESPONSE[s/"create_time": 1518808660505/"create_time": $body.create_time/]