put-pipeline.asciidoc 2.7 KB

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