Skip to content

Commit bf64ebf

Browse files
authored
[DOC] Add ingest error metadata (#75653)
These docs were accidentally removed in #70253.
1 parent bce246d commit bf64ebf

File tree

1 file changed

+30
-4
lines changed

1 file changed

+30
-4
lines changed

docs/reference/ingest.asciidoc

Lines changed: 30 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ template's index pattern should match `logs-<dataset-name>-*`.
323323
--
324324
You can create this template using {kib}'s <<manage-index-templates,**Index
325325
Management**>> feature or the <<indices-put-template,create index template
326-
API>>.
326+
API>>.
327327

328328
For example, the following request creates a template matching `logs-my_app-*`.
329329
The template uses a component template that contains the
@@ -550,7 +550,7 @@ PUT _ingest/pipeline/my-pipeline
550550
"description": "Use geo_point dynamic template for address field",
551551
"field": "_dynamic_templates",
552552
"value": {
553-
"address": "geo_point"
553+
"address": "geo_point"
554554
}
555555
}
556556
}
@@ -560,8 +560,8 @@ PUT _ingest/pipeline/my-pipeline
560560

561561
The set processor above tells ES to use the dynamic template named `geo_point`
562562
for the field `address` if this field is not defined in the mapping of the index
563-
yet. This processor overrides the dynamic template for the field `address` if
564-
already defined in the bulk request, but has no effect on other dynamic
563+
yet. This processor overrides the dynamic template for the field `address` if
564+
already defined in the bulk request, but has no effect on other dynamic
565565
templates defined in the bulk request.
566566

567567
WARNING: If you <<create-document-ids-automatically,automatically generate>>
@@ -717,6 +717,32 @@ PUT _ingest/pipeline/my-pipeline
717717
----
718718
// TEST[s/\.\.\./{"lowercase": {"field":"my-keyword-field"}}/]
719719

720+
Additional information about the pipeline failure may be available in the
721+
document metadata fields `on_failure_message`, `on_failure_processor_type`,
722+
`on_failure_processor_tag`, and `on_failure_pipeline`. These fields are
723+
accessible only from within an `on_failure` block.
724+
725+
The following example uses the error metadata fields to provide additional
726+
information on the document about the failure.
727+
728+
[source,console]
729+
----
730+
PUT _ingest/pipeline/my-pipeline
731+
{
732+
"processors": [ ... ],
733+
"on_failure": [
734+
{
735+
"set": {
736+
"description": "Record error information",
737+
"field": "error_information",
738+
"value": "Processor {{ _ingest.on_failure_processor_type }} with tag {{ _ingest.on_failure_processor_tag }} in pipeline {{ _ingest.on_failure_pipeline }} failed with message {{ _ingest.on_failure_message }}"
739+
}
740+
}
741+
]
742+
}
743+
----
744+
// TEST[s/\.\.\./{"lowercase": {"field":"my-keyword-field"}}/]
745+
720746
[discrete]
721747
[[conditionally-run-processor]]
722748
=== Conditionally run a processor

0 commit comments

Comments
 (0)