From 27f12e480646f0dc80aaa1b3e131b8f564136e64 Mon Sep 17 00:00:00 2001 From: James Rodewig <40268737+jrodewig@users.noreply.github.com> Date: Fri, 23 Jul 2021 12:27:07 -0400 Subject: [PATCH] [DOC] Add ingest error metadata (#75653) (#75658) These docs were accidentally removed in #70253. Co-authored-by: Dan Hermann --- docs/reference/ingest.asciidoc | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/docs/reference/ingest.asciidoc b/docs/reference/ingest.asciidoc index fd1294b235aa0..a1e2103a0c921 100644 --- a/docs/reference/ingest.asciidoc +++ b/docs/reference/ingest.asciidoc @@ -325,7 +325,7 @@ template's index pattern should match `logs--*`. -- You can create this template using {kib}'s <> feature or the <>. +API>>. For example, the following request creates a template matching `logs-my_app-*`. The template uses a component template that contains the @@ -694,6 +694,32 @@ PUT _ingest/pipeline/my-pipeline ---- // TEST[s/\.\.\./{"lowercase": {"field":"my-keyword-field"}}/] +Additional information about the pipeline failure may be available in the +document metadata fields `on_failure_message`, `on_failure_processor_type`, +`on_failure_processor_tag`, and `on_failure_pipeline`. These fields are +accessible only from within an `on_failure` block. + +The following example uses the error metadata fields to provide additional +information on the document about the failure. + +[source,console] +---- +PUT _ingest/pipeline/my-pipeline +{ + "processors": [ ... ], + "on_failure": [ + { + "set": { + "description": "Record error information", + "field": "error_information", + "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 }}" + } + } + ] +} +---- +// TEST[s/\.\.\./{"lowercase": {"field":"my-keyword-field"}}/] + [discrete] [[conditionally-run-processor]] === Conditionally run a processor