update-transform.asciidoc 6.5 KB

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