Skip to content

Commit c2aab8c

Browse files
INGEST: Document Pipeline Processor
* Added documentation for Pipeline Processor * Relates elastic#33188
1 parent 4156cc3 commit c2aab8c

File tree

1 file changed

+102
-0
lines changed

1 file changed

+102
-0
lines changed

docs/reference/ingest/ingest-node.asciidoc

+102
Original file line numberDiff line numberDiff line change
@@ -2075,6 +2075,108 @@ Converts a string to its lowercase equivalent.
20752075
--------------------------------------------------
20762076
// NOTCONSOLE
20772077

2078+
[[pipeline-processor]]
2079+
=== Pipeline Processor
2080+
Executes another pipeline.
2081+
2082+
[[pipeline-options]]
2083+
.Pipeline Options
2084+
[options="header"]
2085+
|======
2086+
| Name | Required | Default | Description
2087+
| `pipeline` | yes | - | The name of the pipeline to execute
2088+
|======
2089+
2090+
[source,js]
2091+
--------------------------------------------------
2092+
{
2093+
"pipeline": {
2094+
"pipeline": "inner-pipeline"
2095+
}
2096+
}
2097+
--------------------------------------------------
2098+
// NOTCONSOLE
2099+
2100+
An example of using this processor for nesting pipelines would be:
2101+
2102+
Define an inner pipeline:
2103+
2104+
[source,js]
2105+
--------------------------------------------------
2106+
PUT _ingest/pipeline/inner-pipeline
2107+
{
2108+
"description" : "inner pipeline",
2109+
"processors" : [
2110+
{
2111+
"set" : {
2112+
"field": "inner_pipeline_set",
2113+
"value": "inner"
2114+
}
2115+
}
2116+
]
2117+
}
2118+
--------------------------------------------------
2119+
// CONSOLE
2120+
2121+
Define another pipeline that uses the previously defined inner pipeline:
2122+
2123+
[source,js]
2124+
--------------------------------------------------
2125+
PUT _ingest/pipeline/outer-pipeline
2126+
{
2127+
"description" : "outer pipeline",
2128+
"processors" : [
2129+
{
2130+
"pipeline" : {
2131+
"pipeline": "inner-pipeline"
2132+
}
2133+
},
2134+
{
2135+
"set" : {
2136+
"field": "outer_pipeline_set",
2137+
"value": "outer"
2138+
}
2139+
}
2140+
]
2141+
}
2142+
--------------------------------------------------
2143+
// CONSOLE
2144+
// TEST[continued]
2145+
2146+
Now indexing a document while applying the outer pipeline will see the inner pipeline executed
2147+
from the outer pipeline:
2148+
2149+
[source,js]
2150+
--------------------------------------------------
2151+
POST /myindex/1?pipeline=outer-pipeline
2152+
{
2153+
"field": "value"
2154+
}
2155+
--------------------------------------------------
2156+
// CONSOLE
2157+
// TEST[continued]
2158+
2159+
Response from the index request:
2160+
2161+
[source,js]
2162+
--------------------------------------------------
2163+
{
2164+
"_index": "myindex",
2165+
"_type": "_doc",
2166+
"_id": "1",
2167+
"_version": 1,
2168+
"result": "created",
2169+
"_shards": {
2170+
"total": 2,
2171+
"successful": 1,
2172+
"failed": 0
2173+
},
2174+
"_seq_no": 0,
2175+
"_primary_term": 1,
2176+
}
2177+
--------------------------------------------------
2178+
// TESTRESPONSE
2179+
20782180
[[remove-processor]]
20792181
=== Remove Processor
20802182
Removes existing fields. If one field doesn't exist, an exception will be thrown.

0 commit comments

Comments
 (0)