put-pipeline.asciidoc 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. [role="xpack"]
  2. [[logstash-api-put-pipeline]]
  3. === Create or update {ls} pipeline API
  4. ++++
  5. <titleabbrev>Create or update {ls} pipeline</titleabbrev>
  6. ++++
  7. .New API reference
  8. [sidebar]
  9. --
  10. For the most up-to-date API details, refer to {api-es}/group/endpoint-logstash[{ls} APIs].
  11. --
  12. This API creates or updates a {ls} pipeline used for
  13. {logstash-ref}/logstash-centralized-pipeline-management.html[{ls} Central
  14. Management].
  15. [[logstash-api-put-pipeline-request]]
  16. ==== {api-request-title}
  17. `PUT _logstash/pipeline/<pipeline_id>`
  18. [[logstash-api-put-pipeline-prereqs]]
  19. ==== {api-prereq-title}
  20. * If the {es} {security-features} are enabled, you must have the
  21. `manage_logstash_pipelines` cluster privilege to use this API.
  22. [[logstash-api-put-pipeline-desc]]
  23. ==== {api-description-title}
  24. Creates a {ls} pipeline. If the specified pipeline exists, the pipeline is
  25. replaced.
  26. [[logstash-api-put-pipeline-params]]
  27. ==== {api-path-parms-title}
  28. `<pipeline_id>`::
  29. (Required, string) Identifier for the pipeline.
  30. [[logstash-api-put-pipeline-request-body]]
  31. ==== {api-request-body-title}
  32. `description`::
  33. (Optional, string)
  34. Description of the pipeline. This description is not used by {es} or {ls}.
  35. `last_modified`::
  36. (Required, string)
  37. Date the pipeline was last updated. Must be in the `yyyy-MM-dd'T'HH:mm:ss.SSSZZ`
  38. <<mapping-date-format,`strict_date_time`>> format.
  39. `pipeline`::
  40. (Required, string)
  41. Configuration for the pipeline. For supported syntax, see the
  42. {logstash-ref}/configuration-file-structure.html[{ls} configuration
  43. documentation].
  44. `pipeline_metadata`::
  45. (Required, object)
  46. Optional metadata about the pipeline. May have any contents. This metadata is
  47. not generated or used by {es} or {ls}.
  48. `pipeline_settings`::
  49. (Required, object)
  50. Settings for the pipeline. Supports only flat keys in dot notation. For
  51. supported settings, see the {logstash-ref}/logstash-settings-file.html[{ls}
  52. settings documentation].
  53. `username`::
  54. (Required, string)
  55. User who last updated the pipeline.
  56. [[logstash-api-put-pipeline-example]]
  57. ==== {api-examples-title}
  58. The following example creates a new pipeline named `my_pipeline`:
  59. [source,console]
  60. --------------------------------------------------
  61. PUT _logstash/pipeline/my_pipeline
  62. {
  63. "description": "Sample pipeline for illustration purposes",
  64. "last_modified": "2021-01-02T02:50:51.250Z",
  65. "pipeline_metadata": {
  66. "type": "logstash_pipeline",
  67. "version": "1"
  68. },
  69. "username": "elastic",
  70. "pipeline": "input {}\n filter { grok {} }\n output {}",
  71. "pipeline_settings": {
  72. "pipeline.workers": 1,
  73. "pipeline.batch.size": 125,
  74. "pipeline.batch.delay": 50,
  75. "queue.type": "memory",
  76. "queue.max_bytes": "1gb",
  77. "queue.checkpoint.writes": 1024
  78. }
  79. }
  80. --------------------------------------------------
  81. If the request succeeds, you receive an empty response with an appropriate
  82. status code.