From 9620db17d196fe560b0b4e0966beca3fe49f279c Mon Sep 17 00:00:00 2001 From: Josh Black Date: Wed, 7 Oct 2020 11:53:07 -0700 Subject: [PATCH] Add API docs for sys/monitor (#9968) --- website/data/api-navigation.js | 1 + website/pages/api-docs/system/monitor.mdx | 42 +++++++++++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 website/pages/api-docs/system/monitor.mdx diff --git a/website/data/api-navigation.js b/website/data/api-navigation.js index 9f998949f4..3791b7f613 100644 --- a/website/data/api-navigation.js +++ b/website/data/api-navigation.js @@ -119,6 +119,7 @@ export default [ category: 'mfa', content: ['duo', 'okta', 'pingid', 'totp'], }, + 'monitor', 'mounts', 'namespaces', 'plugins-reload-backend', diff --git a/website/pages/api-docs/system/monitor.mdx b/website/pages/api-docs/system/monitor.mdx new file mode 100644 index 0000000000..df4f908535 --- /dev/null +++ b/website/pages/api-docs/system/monitor.mdx @@ -0,0 +1,42 @@ +--- +layout: api +page_title: /sys/monitor - HTTP API +sidebar_title: /sys/monitor +description: The `/sys/monitor` endpoint is used to receive streaming logs from the Vault server. +--- + +# `/sys/monitor` + +The `/sys/monitor` endpoint is used to receive streaming logs from the Vault server. + +## Monitor system logs + +This endpoint streams logs back to the client from Vault. Note that unlike most API endpoints in Vault, this one +does not return JSON by default. This will send back data in whatever log format Vault has been configured with. By +default, this is text. + +| Method | Path | +| :----- | :------------ | +| `GET` | `/sys/monitor` | + +### Parameters + +- `log_level` `(string: "info")` – Specifies the log level to use when streaming logs. This defaults to `info` + if not specified. + +### Sample Request + +```shell-session +$ curl \ + --header "X-Vault-Token: ..." \ + http://127.0.0.1:8200/v1/sys/monitor?log_level=debug" +``` + +### Sample Response + +``` +2020-09-15T11:28:09.188-0700 [INFO] core: successful mount: namespace= path=foo/ type=kv +2020-09-15T11:28:18.265-0700 [DEBUG] core.secrets.deletion: clearing view: namespace=root path=foo/ total_keys=0 +2020-09-15T11:28:18.265-0700 [DEBUG] core.secrets.deletion: view cleared: namespace=root path=foo/ +2020-09-15T11:28:18.265-0700 [INFO] core: successfully unmounted: path=foo/ namespace= +```