2018-12-23 08:59:18 -05:00
|
|
|
[[put-pipeline-api]]
|
|
|
|
=== Put Pipeline API
|
|
|
|
|
|
|
|
The put pipeline API adds pipelines and updates existing pipelines in the cluster.
|
|
|
|
|
2019-09-06 11:31:13 -04:00
|
|
|
[source,console]
|
2018-12-23 08:59:18 -05:00
|
|
|
--------------------------------------------------
|
|
|
|
PUT _ingest/pipeline/my-pipeline-id
|
|
|
|
{
|
|
|
|
"description" : "describe pipeline",
|
|
|
|
"processors" : [
|
|
|
|
{
|
|
|
|
"set" : {
|
|
|
|
"field": "foo",
|
|
|
|
"value": "bar"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
--------------------------------------------------
|
|
|
|
|
2019-09-26 08:51:12 -04:00
|
|
|
[float]
|
|
|
|
[[versioning-pipelines]]
|
|
|
|
==== Pipeline versioning
|
|
|
|
|
|
|
|
Pipelines can optionally add a `version` number, which can be any integer value,
|
|
|
|
in order to simplify pipeline management by external systems. The `version`
|
|
|
|
field is completely optional and it is meant solely for external management of
|
|
|
|
pipelines.
|
|
|
|
|
|
|
|
[source,console]
|
|
|
|
--------------------------------------------------
|
|
|
|
PUT /_ingest/pipeline/my-pipeline-id
|
|
|
|
{
|
|
|
|
"description" : "describe pipeline",
|
|
|
|
"version" : 123,
|
|
|
|
"processors" : [
|
|
|
|
{
|
|
|
|
"set" : {
|
|
|
|
"field": "foo",
|
|
|
|
"value": "bar"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
--------------------------------------------------
|
|
|
|
|
|
|
|
To unset a `version`, simply replace the pipeline without specifying
|
|
|
|
one.
|
|
|
|
|
|
|
|
[source,console]
|
|
|
|
--------------------------------------------------
|
|
|
|
PUT /_ingest/pipeline/my-pipeline-id
|
|
|
|
{
|
|
|
|
"description" : "describe pipeline",
|
|
|
|
"processors" : [
|
|
|
|
{
|
|
|
|
"set" : {
|
|
|
|
"field": "foo",
|
|
|
|
"value": "bar"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
--------------------------------------------------
|
|
|
|
|
2018-12-23 08:59:18 -05:00
|
|
|
//////////////////////////
|
|
|
|
|
2019-09-06 11:31:13 -04:00
|
|
|
[source,console]
|
2018-12-23 08:59:18 -05:00
|
|
|
--------------------------------------------------
|
|
|
|
DELETE /_ingest/pipeline/my-pipeline-id
|
|
|
|
--------------------------------------------------
|
|
|
|
// TEST[continued]
|
|
|
|
|
2019-09-06 09:22:08 -04:00
|
|
|
[source,console-result]
|
2018-12-23 08:59:18 -05:00
|
|
|
--------------------------------------------------
|
|
|
|
{
|
|
|
|
"acknowledged": true
|
|
|
|
}
|
|
|
|
--------------------------------------------------
|
|
|
|
|
|
|
|
//////////////////////////
|
|
|
|
|
|
|
|
NOTE: The put pipeline API also instructs all ingest nodes to reload their in-memory representation of pipelines, so that
|
|
|
|
pipeline changes take effect immediately.
|