put-pipeline.asciidoc 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  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. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=timeoutparms]
  39. [[put-pipeline-api-request-body]]
  40. ==== {api-request-body-title}
  41. // tag::pipeline-object[]
  42. `description`::
  43. (Optional, string)
  44. Description of the ingest pipeline.
  45. `on_failure`::
  46. (Optional, array of <<processors,processor>> objects)
  47. Processors to run immediately after a processor failure.
  48. +
  49. Each processor supports a processor-level `on_failure` value. If a processor
  50. without an `on_failure` value fails, {es} uses this pipeline-level parameter as
  51. a fallback. The processors in this parameter run sequentially in the order
  52. specified. {es} will not attempt to run the pipeline's remaining processors.
  53. `processors`::
  54. (Required, array of <<processors,processor>> objects)
  55. Processors used to perform transformations on documents before indexing.
  56. Processors run sequentially in the order specified.
  57. `version`::
  58. (Optional, integer)
  59. Version number used by external systems to track ingest pipelines.
  60. +
  61. This parameter is intended for external systems only. {es} does not use or
  62. validate pipeline version numbers.
  63. `_meta`::
  64. (Optional, object)
  65. Optional metadata about the ingest pipeline. May have any contents. This
  66. map is not automatically generated by {es}.
  67. // end::pipeline-object[]
  68. [[put-pipeline-api-example]]
  69. ==== {api-examples-title}
  70. [[pipeline-metadata]]
  71. ===== Pipeline metadata
  72. You can use the `_meta` parameter to add arbitrary metadata to a pipeline.
  73. This user-defined object is stored in the cluster state,
  74. so keeping it short is preferable.
  75. The `_meta` parameter is optional and not automatically generated or used by {es}.
  76. To unset `_meta`, replace the pipeline without specifying one.
  77. [source,console]
  78. --------------------------------------------------
  79. PUT /_ingest/pipeline/my-pipeline-id
  80. {
  81. "description" : "My optional pipeline description",
  82. "processors" : [
  83. {
  84. "set" : {
  85. "description" : "My optional processor description",
  86. "field": "my-keyword-field",
  87. "value": "foo"
  88. }
  89. }
  90. ],
  91. "_meta": {
  92. "reason": "set my-keyword-field to foo",
  93. "serialization": {
  94. "class": "MyPipeline",
  95. "id": 10
  96. }
  97. }
  98. }
  99. --------------------------------------------------
  100. To check the `_meta`, use the <<get-pipeline-api,get pipeline>> API.