Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion explore-analyze/alerting/alerts/rule-types.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Some rule types are subscription features, while others are free features. For a
| --- | --- |
| [{{es}} query](rule-type-es-query.md) | Run a user-configured {{es}} query, compare the number of matches to a configured threshold, and schedule actions to run when the threshold condition is met. |
| [Index threshold](rule-type-index-threshold.md) | Aggregate field values from documents using {{es}} queries, compare them to threshold values, and schedule actions to run when the thresholds are met. |
| [Transform rules](../../transforms/transform-alerts.md) | {applies_to}`stack: beta` {applies_to}`serverless: beta` Run scheduled checks on a {{ctransform}} to check its health. If a {{ctransform}} meets the conditions, an alert is created and the associated action is triggered. |
| [Transform rules](../../transforms/transform-alerts.md) | Run scheduled checks on a {{ctransform}} to check its health. If a {{ctransform}} meets the conditions, an alert is created and the associated action is triggered. |
| [Tracking containment](geo-alerting.md) | Run an {{es}} query to determine if any documents are currently contained in any boundaries from a specified boundary index and generate alerts when a rule’s conditions are met. |

## {{observability}} rules [observability-rules]
Expand Down
6 changes: 4 additions & 2 deletions explore-analyze/transforms/ecommerce-transforms.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ products:
:::

::::{tip}
On {{serverless-full}}, when your project has [linked projects](/explore-analyze/cross-project-search.md), use the **Project scope** control next to the data view picker to choose which linked projects the transform searches. Refer to [Cross-project search scope](transform-overview.md#transform-cps-scope).
On {{serverless-full}}, when your project has [linked projects](/explore-analyze/cross-project-search.md), use the **Project scope** control next to the data view picker to choose which linked projects the transform searches. Refer to [Source data from linked projects](transform-overview.md#transform-cps-scope).
::::

Group the data by customer ID and add one or more aggregations to learn more about each customer’s orders. For example, let’s calculate the sum of products they purchased, the total price of their purchases, the maximum number of products that they purchased in a single order, and their total number of orders. We’ll accomplish this by using the [`sum` aggregation](elasticsearch://reference/aggregations/search-aggregations-metrics-sum-aggregation.md) on the `total_quantity` and `taxless_total_price` fields, the [`max` aggregation](elasticsearch://reference/aggregations/search-aggregations-metrics-max-aggregation.md) on the `total_quantity` field, and the [`cardinality` aggregation](elasticsearch://reference/aggregations/search-aggregations-metrics-cardinality-aggregation.md) on the `order_id` field:
Expand Down Expand Up @@ -253,6 +253,8 @@ products:

::::

{applies_to}`serverless: ga` On {{serverless-short}}, transforms do not set the number of shards or replicas of the destination index, so the preview does not include these settings.

In some instances the deduced mappings might be incompatible with the actual data. For example, numeric overflows might occur or dynamically mapped fields might contain both numbers and strings. To avoid this problem, create your destination index before you start the transform. For more information, see the [create index API]({{es-apis}}operation/operation-indices-create).

::::{dropdown} API example
Expand Down Expand Up @@ -306,7 +308,7 @@ products:
:::

::::{tip}
On {{serverless-full}}, when your project has [linked projects](/explore-analyze/cross-project-search.md), the **Project scope** column on this page shows which projects each transform searches. Refer to [Cross-project search scope](transform-overview.md#transform-cps-scope).
On {{serverless-full}}, when your project has [linked projects](/explore-analyze/cross-project-search.md), the **Project scope** column on this page shows which projects each transform searches. Refer to [Source data from linked projects](transform-overview.md#transform-cps-scope).
::::

Alternatively, you can use the [start transforms]({{es-apis}}operation/operation-transform-start-transform), [stop transforms]({{es-apis}}operation/operation-transform-stop-transform) and [reset transforms]({{es-apis}}operation/operation-transform-reset-transform) APIs.
Expand Down
10 changes: 7 additions & 3 deletions explore-analyze/transforms/transform-checkpoints.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ If the cluster experiences unsuitable performance degradation due to the transfo

In most cases, it is strongly recommended to use the ingest timestamp of the source indices for syncing the transform. This is the most optimal way for transforms to be able to identify new changes. If your data source follows the [ECS standard](ecs://reference/index.md), you might already have an [`event.ingested`](ecs://reference/ecs-event.md#field-event-ingested) field. In this case, use `event.ingested` as the `sync`.`time`.`field` property of your transform.

If you don't have a `event.ingested` field or it isn't populated, you can set it by using an ingest pipeline. Create an ingest pipeline either using the [ingest pipeline API]({{es-apis}}operation/operation-ingest-put-pipeline) (like the example below) or through {{kib}}'s **Ingest Pipelines** management page. Use a [`set` processor](elasticsearch://reference/enrich-processor/set-processor.md) to set the field and associate it with the value of the ingest timestamp.
If you don't have a `event.ingested` field or it isn't populated, you can set it by using an ingest pipeline. Create an ingest pipeline either using the [ingest pipeline API]({{es-apis}}operation/operation-ingest-put-pipeline) (like the following example) or through {{kib}}'s **Ingest Pipelines** management page. Use a [`set` processor](elasticsearch://reference/ingest-processor/set-processor.md) to set the field and associate it with the value of the ingest timestamp.

```console
PUT _ingest/pipeline/set_ingest_time
Expand Down Expand Up @@ -80,8 +80,12 @@ Failures in transforms tend to be related to searching or indexing. To increase

Checkpoint failures can be categorized as follows:

* Temporary failures: The checkpoint is retried. If 10 consecutive failures occur, the transform has a failed status. For example, this situation might occur when there are shard failures and queries return only partial results.
* Irrecoverable failures: The transform immediately fails. For example, this situation occurs when the source index is not found.
* Temporary failures: The checkpoint is retried up to `num_failure_retries` times (default 10) with an exponential backoff, starting at 5 seconds and capped at 1 hour. Once the retries are exhausted, the transform fails and stops. For example, this situation might occur when there are shard failures and queries return only partial results. You can change the default for all transforms with the `xpack.transform.num_transform_failure_retries` cluster setting. A value of `-1` retries indefinitely.

{applies_to}`stack: ga 9.6+` Authentication and authorization errors are also treated as temporary failures and retried.
* Irrecoverable failures: The transform immediately fails. For example, this situation occurs when the source index is not found, or when an aggregation is not valid for the field type.
* Adjustment failures: The transform retries with adjusted settings. For example, if a parent circuit breaker memory errors occur during the composite aggregation, the transform receives partial results. The aggregated search is retried with a smaller number of buckets. This retry is performed at the interval defined in the `frequency` property for the transform. If the search is retried to the point where it reaches a minimal number of buckets, an irrecoverable failure occurs.

A transform with the `unattended` setting enabled never enters a failed state. It retries all failures indefinitely.

If the node running the transforms fails, the transform restarts from the most recent persisted cursor position. This recovery process might repeat some of the work the transform had already done, but it ensures data consistency.
30 changes: 29 additions & 1 deletion explore-analyze/transforms/transform-examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ The search result shows you data like this for each client IP:
},
"success" : 2,
"error404" : 0,
"error503" : 0,
"error5xx" : 0,
"clientip" : "0.72.176.46",
"agent_dc" : 2.0,
"bytes_sum" : 4422.0,
Expand Down Expand Up @@ -506,6 +506,32 @@ The API call above returns a response similar to this:
}
```

{applies_to}`stack: ga 9.6+` {applies_to}`serverless: ga` Each `top_metrics` result also contains a `top` array with the sort values and metrics of the top documents, in the same format as the `top_metrics` aggregation response in a search. For example, the first document of the preview looks similar to this:

```js
{
"top" : {
"clientip" : "223.87.60.27",
"geo.src" : "IN",
"top" : [
{
"sort" : [ 6219 ],
"metrics" : {
"clientip" : "223.87.60.27",
"geo.src" : "IN"
}
}
]
},
"bytes" : {
"max" : 6219
},
"timestamp" : "2021-04-25T00:00:00.000Z"
}
```

If you set the `size` parameter of `top_metrics` to a value greater than 1, the `top` array contains up to `size` entries, while the flattened fields contain the metrics of the first document. If you create the destination index yourself with `dynamic` set to `strict`, add the `top` field to its mappings.

## Getting customer name and email address by customer ID [example-customer-names]

This example uses the ecommerce sample data set to create an entity-centric index based on customer ID, and to get the customer name and email address by using the `top_metrics` aggregation.
Expand Down Expand Up @@ -586,3 +612,5 @@ The API returns a response that is similar to this:
]
}
```

{applies_to}`stack: ga 9.6+` {applies_to}`serverless: ga` The `last` object also contains a `top` array with the sort value and metrics of the top document, as described in the [previous example](#example-bytes).
Loading
Loading