Skip to content

Commit 663eadc

Browse files
committed
Update docs
1 parent 7baf17f commit 663eadc

File tree

3 files changed

+28
-5
lines changed

3 files changed

+28
-5
lines changed

docs/reference/enrich-processor/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ Refer to [Enrich your data](docs-content://manage-data/ingest/transform-enrich/d
157157
: Converts a string field to lowercase or uppercase.
158158

159159
[`recover_failure_document` processor](/reference/enrich-processor/recover-failure-document-processor.md)
160-
: Converts failure store document to its original format.
160+
: Converts a failure-store document to its original format.
161161

162162
[`split` processor](/reference/enrich-processor/split-processor.md)
163163
: Splits a field into an array of values.

docs/reference/enrich-processor/recover-failure-document-processor.md

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,14 @@ mapped_pages:
66

77
# Recover Failure Document processor [recover_failure_document-processor]
88

9-
Remediates documents that have been stored in a data stream's failure store by restoring them to their original format. This processor is designed to work with documents that failed during ingestion and were automatically stored in the failure store with additional error metadata and document structure wrapping.
9+
Recovers documents that have been stored in a data stream's failure store by restoring them to their original format. This processor is designed to work with documents that failed during ingestion and were automatically stored in the failure store with additional error metadata and document structure wrapping. The relevant failure store metadata is stashed under _ingest.pre_recovery.
1010

1111
The Recover Failure Document processor performs the following operations:
1212

13-
* Extracts the original document source from the `document.source` field
13+
* Checks the document is a valid failure store document.
14+
* Stores the pre-recovery metadata of the document (all document fields except for `document.source`) under the ingest metadata _ingest.pre_recovery.
15+
* Overwrites `_source` with the original document source from the `document.source` field
16+
* Restores the original document id from `document._id` to the document metadata
1417
* Restores the original index name from `document.index` to the document metadata
1518
* Restores the original routing value from `document.routing` to the document metadata (if present)
1619
* Removes the failure-related fields (`error` and `document`) from the document
@@ -82,7 +85,27 @@ Which produces the following response:
8285
"counter_name": "test"
8386
},
8487
"_ingest": {
85-
"timestamp": "2025-08-25T23:33:19.183295Z"
88+
"pre_recovery": {
89+
"@timestamp": "2025-05-09T06:41:24.775Z",
90+
"_index": ".fs-my-datastream-ingest-2025.05.09-000001",
91+
"document": {
92+
"index": "my-datastream-ingest"
93+
},
94+
"_id": "HnTJs5YBwrYNjPmaFcri",
95+
"error": {
96+
"pipeline": "complicated-processor",
97+
"processor_type": "set",
98+
"processor_tag": "copy to new counter again",
99+
"pipeline_trace": [
100+
"complicated-processor"
101+
],
102+
"stack_trace": "j.l.IllegalArgumentException: field [counter] not present as part of path [counter] at o.e.i.IngestDocument.getFieldValue(IngestDocument.java: 202 at o.e.i.c.SetProcessor.execute(SetProcessor.java: 86) 14 more",
103+
"type": "illegal_argument_exception",
104+
"message": "field [counter] not present as part of path [counter]"
105+
},
106+
"_version": -3
107+
},
108+
"timestamp": "2025-09-04T22:32:12.800709Z"
86109
}
87110
}
88111
}

modules/ingest-common/src/main/java/org/elasticsearch/ingest/common/RecoverFailureDocumentProcessor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public IngestDocument execute(IngestDocument document) throws Exception {
7272
// Get the original document's source.
7373
Map<String, Object> originalSource = (Map<String, Object>) failedDocument.get("source");
7474

75-
// Source should match original source contents.
75+
// Overwrite the _source with original source contents.
7676
Map<String, Object> source = document.getSource();
7777
source.clear();
7878
source.putAll(originalSource);

0 commit comments

Comments
 (0)