2019-08-07 11:37:35 -04:00
|
|
|
|
[role="xpack"]
|
|
|
|
|
[testenv="basic"]
|
2019-09-20 18:57:43 -04:00
|
|
|
|
[[update-transform]]
|
2019-09-16 11:28:19 -04:00
|
|
|
|
=== Update {transforms} API
|
2019-08-07 11:37:35 -04:00
|
|
|
|
|
|
|
|
|
[subs="attributes"]
|
|
|
|
|
++++
|
2019-09-16 11:28:19 -04:00
|
|
|
|
<titleabbrev>Update {transforms}</titleabbrev>
|
2019-08-07 11:37:35 -04:00
|
|
|
|
++++
|
|
|
|
|
|
2019-09-16 11:28:19 -04:00
|
|
|
|
Updates an existing {transform}.
|
2019-08-07 11:37:35 -04:00
|
|
|
|
|
|
|
|
|
beta[]
|
|
|
|
|
|
2019-09-20 18:57:43 -04:00
|
|
|
|
[[update-transform-request]]
|
2019-08-07 11:37:35 -04:00
|
|
|
|
==== {api-request-title}
|
|
|
|
|
|
2019-10-08 02:59:01 -04:00
|
|
|
|
`POST _transform/<transform_id>/_update`
|
2019-08-07 11:37:35 -04:00
|
|
|
|
|
2019-09-20 18:57:43 -04:00
|
|
|
|
[[update-transform-prereqs]]
|
2019-08-07 11:37:35 -04:00
|
|
|
|
==== {api-prereq-title}
|
|
|
|
|
|
|
|
|
|
* If the {es} {security-features} are enabled, you must have
|
|
|
|
|
`manage_data_frame_transforms` cluster privileges to use this API. The built-in
|
|
|
|
|
`data_frame_transforms_admin` role has these privileges. You must also
|
|
|
|
|
have `read` and `view_index_metadata` privileges on the source index and `read`,
|
|
|
|
|
`create_index`, and `index` privileges on the destination index. For more
|
2019-10-07 18:23:19 -04:00
|
|
|
|
information, see <<security-privileges>> and <<built-in-roles>>.
|
2019-08-07 11:37:35 -04:00
|
|
|
|
|
2019-09-20 18:57:43 -04:00
|
|
|
|
[[update-transform-desc]]
|
2019-08-07 11:37:35 -04:00
|
|
|
|
==== {api-description-title}
|
|
|
|
|
|
2019-09-16 11:28:19 -04:00
|
|
|
|
This API updates an existing {transform}. All settings except description do not
|
|
|
|
|
take effect until after the {transform} starts the next checkpoint. This is
|
2019-08-07 11:37:35 -04:00
|
|
|
|
so there is consistency with the pivoted data in each checkpoint.
|
|
|
|
|
|
2019-09-16 11:28:19 -04:00
|
|
|
|
IMPORTANT: When {es} {security-features} are enabled, your {transform}
|
2019-08-07 11:37:35 -04:00
|
|
|
|
remembers which roles the user who updated it had at the time of update and
|
|
|
|
|
runs with those privileges.
|
|
|
|
|
|
2019-09-16 11:28:19 -04:00
|
|
|
|
IMPORTANT: You must use {kib} or this API to update a {transform}.
|
|
|
|
|
Do not update a {transform} directly via
|
2019-08-07 11:37:35 -04:00
|
|
|
|
`.data-frame-internal*` indices using the Elasticsearch index API.
|
|
|
|
|
If {es} {security-features} are enabled, do not give users any
|
|
|
|
|
privileges on `.data-frame-internal*` indices.
|
|
|
|
|
|
2019-09-20 18:57:43 -04:00
|
|
|
|
[[update-transform-path-parms]]
|
2019-08-07 11:37:35 -04:00
|
|
|
|
==== {api-path-parms-title}
|
|
|
|
|
|
2019-09-20 18:57:43 -04:00
|
|
|
|
`<transform_id>`::
|
2019-09-16 11:28:19 -04:00
|
|
|
|
(Required, string) Identifier for the {transform}. This identifier
|
2019-08-07 11:37:35 -04:00
|
|
|
|
can contain lowercase alphanumeric characters (a-z and 0-9), hyphens, and
|
|
|
|
|
underscores. It must start and end with alphanumeric characters.
|
|
|
|
|
|
2019-09-20 18:57:43 -04:00
|
|
|
|
[[update-transform-query-parms]]
|
2019-08-07 11:37:35 -04:00
|
|
|
|
==== {api-query-parms-title}
|
|
|
|
|
|
|
|
|
|
`defer_validation`::
|
|
|
|
|
(Optional, boolean) When `true`, deferrable validations are not run. This
|
|
|
|
|
behavior may be desired if the source index does not exist until after the
|
2019-09-16 11:28:19 -04:00
|
|
|
|
{transform} is updated.
|
2019-08-07 11:37:35 -04:00
|
|
|
|
|
2019-09-20 18:57:43 -04:00
|
|
|
|
[[update-transform-request-body]]
|
2019-08-07 11:37:35 -04:00
|
|
|
|
==== {api-request-body-title}
|
|
|
|
|
|
|
|
|
|
`description`::
|
2019-09-16 11:28:19 -04:00
|
|
|
|
(Optional, string) Free text description of the {transform}.
|
2019-08-07 11:37:35 -04:00
|
|
|
|
|
|
|
|
|
`dest`::
|
|
|
|
|
(Optional, object) The destination configuration, which has the
|
|
|
|
|
following properties:
|
|
|
|
|
|
|
|
|
|
`index`:::
|
2019-09-16 11:28:19 -04:00
|
|
|
|
(Required, string) The _destination index_ for the {transform}.
|
2019-08-07 11:37:35 -04:00
|
|
|
|
|
|
|
|
|
`pipeline`:::
|
|
|
|
|
(Optional, string) The unique identifier for a <<pipeline,pipeline>>.
|
|
|
|
|
|
|
|
|
|
`frequency`::
|
2019-08-08 07:43:55 -04:00
|
|
|
|
(Optional, <<time-units, time units>>) The interval between checks for changes
|
2019-09-16 11:28:19 -04:00
|
|
|
|
in the source indices when the {transform} is running continuously.
|
2019-08-08 07:43:55 -04:00
|
|
|
|
Also determines the retry interval in the event of transient failures while
|
2019-09-16 11:28:19 -04:00
|
|
|
|
the {transform} is searching or indexing. The minimum value is `1s`
|
2019-08-08 07:43:55 -04:00
|
|
|
|
and the maximum is `1h`. The default value is `1m`.
|
2019-08-07 11:37:35 -04:00
|
|
|
|
|
|
|
|
|
`source`::
|
|
|
|
|
(Optional, object) The source configuration, which has the following
|
|
|
|
|
properties:
|
|
|
|
|
|
|
|
|
|
`index`:::
|
|
|
|
|
(Required, string or array) The _source indices_ for the
|
2019-09-16 11:28:19 -04:00
|
|
|
|
{transform}. It can be a single index, an index pattern (for
|
2019-08-07 11:37:35 -04:00
|
|
|
|
example, `"myindex*"`), or an array of indices (for example,
|
|
|
|
|
`["index1", "index2"]`).
|
|
|
|
|
|
|
|
|
|
`query`:::
|
|
|
|
|
(Optional, object) A query clause that retrieves a subset of data from the
|
|
|
|
|
source index. See <<query-dsl>>.
|
|
|
|
|
|
|
|
|
|
`sync`::
|
|
|
|
|
(Optional, object) Defines the properties required to run continuously.
|
|
|
|
|
`time`:::
|
2019-09-16 11:28:19 -04:00
|
|
|
|
(Required, object) Specifies that the {transform} uses a time
|
2019-08-07 11:37:35 -04:00
|
|
|
|
field to synchronize the source and destination indices.
|
|
|
|
|
`field`::::
|
|
|
|
|
(Required, string) The date field that is used to identify new documents
|
|
|
|
|
in the source.
|
|
|
|
|
+
|
|
|
|
|
--
|
|
|
|
|
TIP: In general, it’s a good idea to use a field that contains the
|
|
|
|
|
<<accessing-ingest-metadata,ingest timestamp>>. If you use a different field,
|
|
|
|
|
you might need to set the `delay` such that it accounts for data transmission
|
|
|
|
|
delays.
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
|
`delay`::::
|
2019-08-08 07:43:55 -04:00
|
|
|
|
(Optional, <<time-units, time units>>) The time delay between the current
|
|
|
|
|
time and the latest input data time. The default value is `60s`.
|
2019-08-07 11:37:35 -04:00
|
|
|
|
|
2019-09-20 18:57:43 -04:00
|
|
|
|
[[update-transform-example]]
|
2019-08-07 11:37:35 -04:00
|
|
|
|
==== {api-examples-title}
|
|
|
|
|
|
2019-09-09 13:38:14 -04:00
|
|
|
|
[source,console]
|
2019-08-07 11:37:35 -04:00
|
|
|
|
--------------------------------------------------
|
2019-10-08 02:59:01 -04:00
|
|
|
|
POST _transform/simple-kibana-ecomm-pivot/_update
|
2019-08-07 11:37:35 -04:00
|
|
|
|
{
|
|
|
|
|
"source": {
|
|
|
|
|
"index": "kibana_sample_data_ecommerce",
|
|
|
|
|
"query": {
|
|
|
|
|
"term": {
|
|
|
|
|
"geoip.continent_name": {
|
|
|
|
|
"value": "Asia"
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
"description": "Maximum priced ecommerce data by customer_id in Asia",
|
|
|
|
|
"dest": {
|
|
|
|
|
"index": "kibana_sample_data_ecommerce_transform_v2",
|
|
|
|
|
"pipeline": "add_timestamp_pipeline"
|
|
|
|
|
},
|
|
|
|
|
"frequency": "15m",
|
|
|
|
|
"sync": {
|
|
|
|
|
"time": {
|
|
|
|
|
"field": "order_date",
|
|
|
|
|
"delay": "120s"
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
--------------------------------------------------
|
|
|
|
|
// TEST[setup:simple_kibana_continuous_pivot]
|
|
|
|
|
|
2019-09-16 11:28:19 -04:00
|
|
|
|
When the {transform} is updated, you receive the updated configuration:
|
2019-09-06 16:09:09 -04:00
|
|
|
|
|
|
|
|
|
[source,console-result]
|
2019-08-07 11:37:35 -04:00
|
|
|
|
----
|
|
|
|
|
{
|
|
|
|
|
"id": "simple-kibana-ecomm-pivot",
|
|
|
|
|
"source": {
|
|
|
|
|
"index": ["kibana_sample_data_ecommerce"],
|
|
|
|
|
"query": {
|
|
|
|
|
"term": {
|
|
|
|
|
"geoip.continent_name": {
|
|
|
|
|
"value": "Asia"
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
"pivot": {
|
|
|
|
|
"group_by": {
|
|
|
|
|
"customer_id": {
|
|
|
|
|
"terms": {
|
|
|
|
|
"field": "customer_id"
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
"aggregations": {
|
|
|
|
|
"max_price": {
|
|
|
|
|
"max": {
|
|
|
|
|
"field": "taxful_total_price"
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
"description": "Maximum priced ecommerce data by customer_id in Asia",
|
|
|
|
|
"dest": {
|
|
|
|
|
"index": "kibana_sample_data_ecommerce_transform_v2",
|
|
|
|
|
"pipeline": "add_timestamp_pipeline"
|
|
|
|
|
},
|
|
|
|
|
"frequency": "15m",
|
|
|
|
|
"sync": {
|
|
|
|
|
"time": {
|
|
|
|
|
"field": "order_date",
|
|
|
|
|
"delay": "120s"
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
"version": "7.4.0",
|
|
|
|
|
"create_time": 1518808660505
|
|
|
|
|
}
|
|
|
|
|
----
|
|
|
|
|
// TESTRESPONSE[s/"version": "7.4.0"/"version": $body.version/]
|
|
|
|
|
// TESTRESPONSE[s/"create_time": 1518808660505/"create_time": $body.create_time/]
|