put-pipeline.asciidoc 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. [[put-pipeline-api]]
  2. === Create or update pipeline API
  3. ++++
  4. <titleabbrev>Create or update pipeline</titleabbrev>
  5. ++++
  6. Creates or updates an <<ingest,ingest pipeline>>. Changes made using this API
  7. take effect immediately.
  8. [source,console]
  9. ----
  10. PUT _ingest/pipeline/my-pipeline-id
  11. {
  12. "description" : "My optional pipeline description",
  13. "processors" : [
  14. {
  15. "set" : {
  16. "description" : "My optional processor description",
  17. "field": "my-keyword-field",
  18. "value": "foo"
  19. }
  20. }
  21. ]
  22. }
  23. ----
  24. [[put-pipeline-api-request]]
  25. ==== {api-request-title}
  26. `PUT /_ingest/pipeline/<pipeline>`
  27. [[put-pipeline-api-prereqs]]
  28. ==== {api-prereq-title}
  29. * If the {es} {security-features} are enabled, you must have the
  30. `manage_pipeline`, `manage_ingest_pipelines`, or `manage`
  31. <<privileges-list-cluster,cluster privilege>> to use this API.
  32. [[put-pipeline-api-path-params]]
  33. ==== {api-path-parms-title}
  34. `<pipeline>`::
  35. (Required, string) ID of the ingest pipeline to create or update.
  36. [[put-pipeline-api-query-params]]
  37. ==== {api-query-parms-title}
  38. `if_version`::
  39. (Optional, integer) Perform the operation only if the pipeline has this
  40. version. If specified and the update is successful, the pipeline's
  41. version is incremented.
  42. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=timeoutparms]
  43. [[put-pipeline-api-request-body]]
  44. ==== {api-request-body-title}
  45. // tag::pipeline-object[]
  46. `description`::
  47. (Optional, string)
  48. Description of the ingest pipeline.
  49. `on_failure`::
  50. (Optional, array of <<processors,processor>> objects)
  51. Processors to run immediately after a processor failure.
  52. +
  53. Each processor supports a processor-level `on_failure` value. If a processor
  54. without an `on_failure` value fails, {es} uses this pipeline-level parameter as
  55. a fallback. The processors in this parameter run sequentially in the order
  56. specified. {es} will not attempt to run the pipeline's remaining processors.
  57. `processors`::
  58. (Required, array of <<processors,processor>> objects)
  59. Processors used to perform transformations on documents before indexing.
  60. Processors run sequentially in the order specified.
  61. `version`::
  62. (Optional, integer)
  63. Version number used by external systems to track ingest pipelines.
  64. +
  65. See the <<put-pipeline-api-query-params,`if_version`>> parameter above for
  66. how the version attribute is used.
  67. `_meta`::
  68. (Optional, object)
  69. Optional metadata about the ingest pipeline. May have any contents. This
  70. map is not automatically generated by {es}.
  71. // end::pipeline-object[]
  72. [[put-pipeline-api-example]]
  73. ==== {api-examples-title}
  74. [[pipeline-metadata]]
  75. ===== Pipeline metadata
  76. You can use the `_meta` parameter to add arbitrary metadata to a pipeline.
  77. This user-defined object is stored in the cluster state,
  78. so keeping it short is preferable.
  79. The `_meta` parameter is optional and not automatically generated or used by {es}.
  80. To unset `_meta`, replace the pipeline without specifying one.
  81. [source,console]
  82. --------------------------------------------------
  83. PUT /_ingest/pipeline/my-pipeline-id
  84. {
  85. "description" : "My optional pipeline description",
  86. "processors" : [
  87. {
  88. "set" : {
  89. "description" : "My optional processor description",
  90. "field": "my-keyword-field",
  91. "value": "foo"
  92. }
  93. }
  94. ],
  95. "_meta": {
  96. "reason": "set my-keyword-field to foo",
  97. "serialization": {
  98. "class": "MyPipeline",
  99. "id": 10
  100. }
  101. }
  102. }
  103. --------------------------------------------------
  104. To check the `_meta`, use the <<get-pipeline-api,get pipeline>> API.