Pipeline processor

Executes another pipeline.

Table 28. Pipeline Options

NameRequiredDefaultDescription

name

yes

-

The name of the pipeline to execute. Supports template snippets.

if

no

-

Conditionally execute this processor.

on_failure

no

-

Handle failures for this processor. See Handling Failures in Pipelines.

ignore_failure

no

false

Ignore failures for this processor. See Handling Failures in Pipelines.

tag

no

-

An identifier for this processor. Useful for debugging and metrics.

  1. {
  2. "pipeline": {
  3. "name": "inner-pipeline"
  4. }
  5. }

The name of the current pipeline can be accessed from the _ingest.pipeline ingest metadata key.

An example of using this processor for nesting pipelines would be:

Define an inner pipeline:

  1. PUT _ingest/pipeline/pipelineA
  2. {
  3. "description" : "inner pipeline",
  4. "processors" : [
  5. {
  6. "set" : {
  7. "field": "inner_pipeline_set",
  8. "value": "inner"
  9. }
  10. }
  11. ]
  12. }

Define another pipeline that uses the previously defined inner pipeline:

  1. PUT _ingest/pipeline/pipelineB
  2. {
  3. "description" : "outer pipeline",
  4. "processors" : [
  5. {
  6. "pipeline" : {
  7. "name": "pipelineA"
  8. }
  9. },
  10. {
  11. "set" : {
  12. "field": "outer_pipeline_set",
  13. "value": "outer"
  14. }
  15. }
  16. ]
  17. }

Now indexing a document while applying the outer pipeline will see the inner pipeline executed from the outer pipeline:

  1. PUT /my-index/_doc/1?pipeline=pipelineB
  2. {
  3. "field": "value"
  4. }

Response from the index request:

  1. {
  2. "_index": "my-index",
  3. "_type": "_doc",
  4. "_id": "1",
  5. "_version": 1,
  6. "result": "created",
  7. "_shards": {
  8. "total": 2,
  9. "successful": 1,
  10. "failed": 0
  11. },
  12. "_seq_no": 66,
  13. "_primary_term": 1,
  14. }

Indexed document:

  1. {
  2. "field": "value",
  3. "inner_pipeline_set": "inner",
  4. "outer_pipeline_set": "outer"
  5. }