get-pipeline.asciidoc 2.5 KB

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