CF Drain CLI Plugin
The CF Drain CLI Plugin is a CF CLI plugin to simplify interactions
with user provided syslog drains.
Installing Plugin
cf install-plugin -r CF-Community "drains"
From Binary Release
- Download the binary for the latest release for your
platform.
- Install it into the cf cli:
cf install-plugin download/path/cf-drain-cli
From Source Code
Make sure to have the latest Go toolchain installed.
go get code.cloudfoundry.org/cf-drain-cli/cmd/cf-drain-cli
cf install-plugin $GOPATH/bin/cf-drain-cli
Usage
Create Drain
$ cf drain --help
NAME:
drain - Creates a user provided service for syslog drains and binds it to a given application.
USAGE:
drain <app-name> <syslog-drain-url> [options]
OPTIONS:
--drain-name The name of the drain that will be created. If excluded, the drain name will be `cf-drain-UUID`.
--type The type of logs to be sent to the syslog drain. Available types: `logs`, `metrics`, and `all`. Default is `logs`
Delete Drain
$ cf delete-drain --help
NAME:
delete-drain - Unbinds the service from applications and deletes the
service.
USAGE:
delete-drain <drain-name>
Bind Drain
$ cf bind-drain --help
NAME:
bind-drain - Binds an application to an existing syslog drain.
USAGE:
bind-drain <app-name> <drain-name>
List Drains
$ cf drains --help
NAME:
drains - Lists all services for syslog drains.
USAGE:
drains
Space Drain
NAME:
drain-space - Pushes app to bind all apps in the space to the configured syslog drain
USAGE:
drain-space [OPTIONS]
OPTIONS:
--drain-name Name for the space drain. Required
--drain-url Syslog endpoint for the space drain. Required
--path Path to the space drain app to push. If omitted the latest release will be downloaded
--type Which log type to filter on (logs, metrics, all). Default is all
--username Username to use when pushing the app. If not specified, a user will be created (requires admin permissions)
V2 Commands
Note:
These commands use an API known as the RLP (Reverse Log Proxy) Gateway. The
RLP Gateway is not necessarily deployed with CF Deployment by default. If you
are unsure if it is available to you, please check with your operator.
Drain Service
NAME:
v2-drain-service - Pushes app to drain a single service
USAGE:
v2-drain-service SERVICE_NAME SYSLOG_DRAIN_URL --path PATH
OPTIONS:
--path Path to the service drain zip file.
Drain Services In Space
NAME:
v2-drain-services-in-space - Pushes app to drain all services in space
USAGE:
v2-drain-services-in-space SYSLOG_DRAIN_URL --path PATH
OPTIONS:
--path Path to the service drain zip file.
Migrate Space Drain
NAME:
v2-migrate-space-drain - Migrates space drain using CUPS to space drain using syslog-forwarder application
USAGE:
v2-migrate-space-drain SYSLOG_DRAIN_URL
OPTIONS:
--drain-name Name for the space drain
--path Path to the syslog-forwarder zip file. If omitted the latest release will be downloaded