Skip to content

Commit

Permalink
[DOC] Add ingest error metadata (elastic#75653) (elastic#75658)
Browse files Browse the repository at this point in the history
These docs were accidentally removed in elastic#70253.

Co-authored-by: Dan Hermann <danhermann@users.noreply.github.com>
  • Loading branch information
jrodewig and danhermann committed Jul 23, 2021
1 parent fb98dc1 commit 27f12e4
Showing 1 changed file with 27 additions and 1 deletion.
28 changes: 27 additions & 1 deletion docs/reference/ingest.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ template's index pattern should match `logs-<dataset-name>-*`.
--
You can create this template using {kib}'s <<manage-index-templates,**Index
Management**>> feature or the <<indices-put-template,create index template
API>>.
API>>.

For example, the following request creates a template matching `logs-my_app-*`.
The template uses a component template that contains the
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 27f12e4

Please sign in to comment.