Update a transform
- POST /_transform/{transform_id}/_update
Updates certain properties of a transform.
All updated properties except description do not take effect until after the transform starts the next checkpoint,
thus there is data consistency in each checkpoint. To use this API, you must have read and view_index_metadata
privileges for the source indices. You must also have index and read privileges for the destination index. When
Elasticsearch security features are enabled, the transform remembers which roles the user who updated it had at the
time of update and runs with those privileges.
Required authorization
- Index privileges read index view_index_metadata
- Cluster privileges manage_transform
Request body
-
destobject -
The destination for the transform.
-
indexstring -
The destination index for the transform. The mappings of the destination index are deduced based on the source fields when possible. If alternate mappings are required, use the create index API prior to starting the transform.
-
aliasesobject -
The aliases that the destination index for the transform should have. Aliases are manipulated using the stored credentials of the transform, which means the secondary credentials supplied at creation time (if both primary and secondary credentials are specified).
The destination index is added to the aliases regardless of whether the destination index was created by the transform or pre-created by the user.
-
move_on_creationboolean · default: false -
Whether the destination index should be the only index in this alias. If
true, all the other indices will be removed from this alias before adding the destination index to this alias. This does not delete the removed indices; it only removes them from the alias. -
frequencystring · default: 1m -
The interval between checks for changes in the source indices when the transform is running continuously. Also determines the retry interval in the event of transient failures while the transform is searching or indexing. The minimum value is 1s and the maximum is 1h.
-
sourceobject -
The source of the data for the transform.
-
indexstringrequired -
The source indices for the transform. It can be a single index, an index pattern (for example,
"my-index-*""), an array of indices (for example,["my-index-000001", "my-index-000002"]), or an array of index patterns (for example,["my-index-*", "my-other-index-*"]. For remote indices use the syntax"remote_name:index_name". If any indices are in remote clusters then the master node and at least one transform node must have theremote_cluster_clientnode role. -
settingsobject -
Defines optional transform settings.
-
align_checkpointsboolean · default: true -
Specifies whether the transform checkpoint ranges should be optimized for performance. Such optimization can align checkpoint ranges with the date histogram interval when date histogram is specified as a group source in the transform config. As a result, less document updates in the destination index will be performed thus improving overall performance.
-
dates_as_epoch_millisboolean · default: false -
Defines if dates in the ouput should be written as ISO formatted string or as millis since epoch. epoch_millis was the default for transforms created before version 7.11. For compatible output set this value to
true. -
deduce_mappingsboolean · default: true -
Specifies whether the transform should deduce the destination index mappings from the transform configuration.
-
docs_per_secondnumber -
Specifies a limit on the number of input documents per second. This setting throttles the transform by adding a wait time between search requests. The default value is null, which disables throttling.
-
max_page_search_sizenumber -
Defines the initial page size to use for the composite aggregation for each checkpoint. If circuit breaker exceptions occur, the page size is dynamically adjusted to a lower value. The minimum value is
10and the maximum is65,536. The default value is500forpivottransforms and5000forlatesttransforms. -
use_point_in_timeboolean · default: true -
Specifies whether the transform checkpoint will use the Point In Time API while searching over the source index. In general, Point In Time is an optimization that will reduce pressure on the source index by reducing the amount of refreshes and merges, but it can be expensive if a large number of Point In Times are opened and closed for a given index. The benefits and impact depend on the data being searched, the ingest rate into the source index, and the amount of other consumers searching the same source index.
- Reference
-
num_failure_retriesnumber -
Defines the number of retries on a recoverable failure before the transform task is marked as
failed. The minimum value is0and the maximum is100, where-1indicates that the transform retries indefinitely. If unset, the cluster-level settingnum_transform_failure_retriesis used.This setting cannot be specified when
unattendedistrue, because unattended transforms always retry indefinitely.
Response
-
If an API key was used for the most recent update to the transform, its name and identifier are listed in the response.
-
The identifier for the API key.
-
The name of the API key.
-
If a user ID was used for the most recent update to the transform, its roles at the time of the update are listed in the response.
-
If a service account was used for the most recent update to the transform, the account name is listed in the response.
-
destobjectrequired -
indexstring -
The destination index for the transform. The mappings of the destination index are deduced based on the source fields when possible. If alternate mappings are required, use the create index API prior to starting the transform.
-
aliasesobject -
The aliases that the destination index for the transform should have. Aliases are manipulated using the stored credentials of the transform, which means the secondary credentials supplied at creation time (if both primary and secondary credentials are specified).
The destination index is added to the aliases regardless of whether the destination index was created by the transform or pre-created by the user.
-
move_on_creationboolean · default: false -
Whether the destination index should be the only index in this alias. If
true, all the other indices will be removed from this alias before adding the destination index to this alias. This does not delete the removed indices; it only removes them from the alias. -
pivotobject -
aggregationsmap string to Aggregation -
Defines how to aggregate the grouped data. The following aggregations are currently supported: average, bucket script, bucket selector, cardinality, filter, geo bounds, geo centroid, geo line, max, median absolute deviation, min, missing, percentiles, rare terms, scripted metric, stats, sum, terms, top metrics, value count, weighted average.
-
group_bymap string to object -
Defines how to group the data. More than one grouping can be defined per pivot. The following groupings are currently supported: date histogram, geotile grid, histogram, terms.
-
<string>object · min properties: 1 · max properties: 1 -
date_histogramobject -
calendar_interval -
Calendar-aware interval. Can be specified using the unit name, such as
month, or as a single unit quantity, such as1M. -
Values:
second1sminute1mhour1hday1dweek1wmonth1Mquarter1qyear1y -
fixed_intervalstring -
Fixed intervals: a fixed number of SI units and never deviate, regardless of where they fall on the calendar.
-
formatstring -
The date format used to format
key_as_stringin the response. If noformatis specified, the first date format specified in the field mapping is used. -
min_doc_countnumber -
Only returns buckets that have
min_doc_countnumber of documents. By default, all buckets between the first bucket that matches documents and the last one are returned. -
missingunion -
The value to apply to documents that do not have a value. By default, documents without a value are ignored.
-
offsetstring -
Changes the start value of each bucket by the specified positive (
+) or negative offset (-) duration. -
geotile_gridobject -
histogramobject -
hard_boundsobject -
Limits the range of buckets in the histogram. It is particularly useful in the case of open data ranges that can result in a very large number of buckets.
-
min_doc_countnumber -
Only returns buckets that have
min_doc_countnumber of documents. By default, the response will fill gaps in the histogram with empty buckets. -
missingnumber -
The value to apply to documents that do not have a value. By default, documents without a value are ignored.
-
offsetnumber -
By default, the bucket keys start with 0 and then continue in even spaced steps of
interval. The bucket boundaries can be shifted by using theoffsetoption. -
termsobject -
collect_mode -
Determines how child aggregations should be calculated: breadth-first or depth-first.
Supported values include:
depth_first: Expands all branches of the aggregation tree in one depth-first pass, before any pruning occurs.breadth_first: Caches the set of documents that fall into the uppermost buckets for subsequent replay.
-
Values:
depth_firstbreadth_first -
execution_hint -
Determines whether the aggregation will use field values directly or global ordinals.
-
Values:
mapglobal_ordinalsglobal_ordinals_hashglobal_ordinals_low_cardinality -
min_doc_countnumber · default: 1 -
Only return values that are found in more than
min_doc_counthits. -
missingboolean | number | string -
The value to apply to documents that do not have a value. By default, documents without a value are ignored.
-
orderunion -
Specifies the sort order of the buckets. Defaults to sorting by descending document count.
-
shard_min_doc_countnumber -
Regulates the certainty a shard has if the term should actually be added to the candidate list or not with respect to the
min_doc_count. Terms will only be considered if their local shard frequency within the set is higher than theshard_min_doc_count. -
shard_sizenumber -
The number of candidate terms produced by each shard. By default,
shard_sizewill be automatically estimated based on the number of shards and thesizeparameter. -
settingsobjectrequired -
align_checkpointsboolean · default: true -
Specifies whether the transform checkpoint ranges should be optimized for performance. Such optimization can align checkpoint ranges with the date histogram interval when date histogram is specified as a group source in the transform config. As a result, less document updates in the destination index will be performed thus improving overall performance.
-
dates_as_epoch_millisboolean · default: false -
Defines if dates in the ouput should be written as ISO formatted string or as millis since epoch. epoch_millis was the default for transforms created before version 7.11. For compatible output set this value to
true. -
deduce_mappingsboolean · default: true -
Specifies whether the transform should deduce the destination index mappings from the transform configuration.
-
docs_per_secondnumber -
Specifies a limit on the number of input documents per second. This setting throttles the transform by adding a wait time between search requests. The default value is null, which disables throttling.
-
max_page_search_sizenumber -
Defines the initial page size to use for the composite aggregation for each checkpoint. If circuit breaker exceptions occur, the page size is dynamically adjusted to a lower value. The minimum value is
10and the maximum is65,536. The default value is500forpivottransforms and5000forlatesttransforms. -
use_point_in_timeboolean · default: true -
Specifies whether the transform checkpoint will use the Point In Time API while searching over the source index. In general, Point In Time is an optimization that will reduce pressure on the source index by reducing the amount of refreshes and merges, but it can be expensive if a large number of Point In Times are opened and closed for a given index. The benefits and impact depend on the data being searched, the ingest rate into the source index, and the amount of other consumers searching the same source index.
- Reference
-
num_failure_retriesnumber -
Defines the number of retries on a recoverable failure before the transform task is marked as
failed. The minimum value is0and the maximum is100, where-1indicates that the transform retries indefinitely. If unset, the cluster-level settingnum_transform_failure_retriesis used.This setting cannot be specified when
unattendedistrue, because unattended transforms always retry indefinitely. -
sourceobjectrequired -
indexstringrequired -
The name of the data stream, index, or alias you are copying from. It accepts a comma-separated list to reindex from multiple sources.
-
queryQuery -
The documents to reindex, which is defined with Query DSL.
-
sizenumber · default: 1000 -
The number of documents to index per batch. Use it when you are indexing from remote to ensure that the batches fit within the on-heap buffer, which defaults to a maximum size of 100 MB.
-
sliceobject -
Slice the reindex request manually using the provided slice ID and total number of slices.
-
sortuniondeprecated -
A comma-separated list of
<field>:<direction>pairs to sort by before indexing. Use it in conjunction withmax_docsto control what documents are reindexed.WarningSort in reindex is deprecated. Sorting in reindex was never guaranteed to index documents in order and prevents further development of reindex such as resilience and performance improvements. If used in combination with
max_docs, consider using a query filter instead.