get-pipeline.asciidoc 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. [role="xpack"]
  2. [[logstash-api-get-pipeline]]
  3. === Get pipeline API
  4. ++++
  5. <titleabbrev>Get {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 retrieves pipelines used for
  13. {logstash-ref}/logstash-centralized-pipeline-management.html[{ls} Central
  14. Management].
  15. [[logstash-api-get-pipeline-request]]
  16. ==== {api-request-title}
  17. `GET _logstash/pipeline`
  18. `GET _logstash/pipeline/<pipeline_id>`
  19. [[logstash-api-get-pipeline-prereqs]]
  20. ==== {api-prereq-title}
  21. * If the {es} {security-features} are enabled, you must have the
  22. `manage_logstash_pipelines` cluster privilege to use this API.
  23. [[logstash-api-get-pipeline-desc]]
  24. ==== {api-description-title}
  25. Retrieve one or more {ls} pipelines.
  26. [[logstash-api-get-pipeline-params]]
  27. ==== {api-path-parms-title}
  28. `<pipeline_id>`::
  29. (Optional, string) Comma-separated list of pipeline identifiers.
  30. [[logstash-api-get-pipeline-example]]
  31. ==== {api-examples-title}
  32. The following example retrieves the pipeline named `my_pipeline`:
  33. //////////////////////////
  34. [source,console]
  35. --------------------------------------------------
  36. PUT _logstash/pipeline/my_pipeline
  37. {
  38. "description": "Sample pipeline for illustration purposes",
  39. "last_modified": "2021-01-02T02:50:51.250Z",
  40. "pipeline_metadata": {
  41. "type": "logstash_pipeline",
  42. "version": "1"
  43. },
  44. "username": "elastic",
  45. "pipeline": "input {}\n filter { grok {} }\n output {}",
  46. "pipeline_settings": {
  47. "pipeline.workers": 1,
  48. "pipeline.batch.size": 125,
  49. "pipeline.batch.delay": 50,
  50. "queue.type": "memory",
  51. "queue.max_bytes": "1gb",
  52. "queue.checkpoint.writes": 1024
  53. }
  54. }
  55. --------------------------------------------------
  56. //////////////////////////
  57. [source,console]
  58. --------------------------------------------------
  59. GET _logstash/pipeline/my_pipeline
  60. --------------------------------------------------
  61. // TEST[continued]
  62. If the request succeeds, the body of the response contains the pipeline definition:
  63. [source,console-result]
  64. --------------------------------------------------
  65. {
  66. "my_pipeline": {
  67. "description": "Sample pipeline for illustration purposes",
  68. "last_modified": "2021-01-02T02:50:51.250Z",
  69. "pipeline_metadata": {
  70. "type": "logstash_pipeline",
  71. "version": "1"
  72. },
  73. "username": "elastic",
  74. "pipeline": "input {}\n filter { grok {} }\n output {}",
  75. "pipeline_settings": {
  76. "pipeline.workers": 1,
  77. "pipeline.batch.size": 125,
  78. "pipeline.batch.delay": 50,
  79. "queue.type": "memory",
  80. "queue.max_bytes": "1gb",
  81. "queue.checkpoint.writes": 1024
  82. }
  83. }
  84. }
  85. --------------------------------------------------
  86. // TESTRESPONSE