get-pipeline.asciidoc 2.5 KB

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