123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112 |
- [[pipeline-processor]]
- === Pipeline Processor
- Executes another pipeline.
- [[pipeline-options]]
- .Pipeline Options
- [options="header"]
- |======
- | Name | Required | Default | Description
- | `name` | yes | - | The name of the pipeline to execute. Supports <<accessing-template-fields,template snippets>>.
- include::common-options.asciidoc[]
- |======
- [source,js]
- --------------------------------------------------
- {
- "pipeline": {
- "name": "inner-pipeline"
- }
- }
- --------------------------------------------------
- // NOTCONSOLE
- 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:
- [source,console]
- --------------------------------------------------
- PUT _ingest/pipeline/pipelineA
- {
- "description" : "inner pipeline",
- "processors" : [
- {
- "set" : {
- "field": "inner_pipeline_set",
- "value": "inner"
- }
- }
- ]
- }
- --------------------------------------------------
- Define another pipeline that uses the previously defined inner pipeline:
- [source,console]
- --------------------------------------------------
- PUT _ingest/pipeline/pipelineB
- {
- "description" : "outer pipeline",
- "processors" : [
- {
- "pipeline" : {
- "name": "pipelineA"
- }
- },
- {
- "set" : {
- "field": "outer_pipeline_set",
- "value": "outer"
- }
- }
- ]
- }
- --------------------------------------------------
- // TEST[continued]
- Now indexing a document while applying the outer pipeline will see the inner pipeline executed
- from the outer pipeline:
- [source,console]
- --------------------------------------------------
- PUT /myindex/_doc/1?pipeline=pipelineB
- {
- "field": "value"
- }
- --------------------------------------------------
- // TEST[continued]
- Response from the index request:
- [source,console-result]
- --------------------------------------------------
- {
- "_index": "myindex",
- "_id": "1",
- "_version": 1,
- "result": "created",
- "_shards": {
- "total": 2,
- "successful": 1,
- "failed": 0
- },
- "_seq_no": 66,
- "_primary_term": 1,
- }
- --------------------------------------------------
- // TESTRESPONSE[s/"_seq_no": \d+/"_seq_no" : $body._seq_no/ s/"_primary_term" : 1/"_primary_term" : $body._primary_term/]
- Indexed document:
- [source,js]
- --------------------------------------------------
- {
- "field": "value",
- "inner_pipeline_set": "inner",
- "outer_pipeline_set": "outer"
- }
- --------------------------------------------------
- // NOTCONSOLE
|