gcloud_beta_logging_sinks_create (1)
NAME
- gcloud beta logging sinks create - creates a sink
SYNOPSIS
-
gcloud beta logging sinks create SINK_NAME DESTINATION [--include-children] [--log-filter=LOG_FILTER] [--billing-account=BILLING_ACCOUNT_ID | --folder=FOLDER_ID | --organization=ORGANIZATION_ID] [GCLOUD_WIDE_FLAG ...]
DESCRIPTION
(BETA) Creates a sink used to export entries from one or more logs to a
POSITIONAL ARGUMENTS
-
- SINK_NAME
-
The name for the sink.
- DESTINATION
-
The destination for the sink.
FLAGS
-
- --include-children
-
Whether to export logs from all child projects and folders. Only applies to
sinks for organizations and folders.
- --log-filter=LOG_FILTER
-
A filter expression for the sink. If present, the filter specifies which log
entries to export.
-
At most one of these may be specified:
-
- --billing-account=BILLING_ACCOUNT_ID
-
Create a sink associated with this billing account.
- --folder=FOLDER_ID
-
Create a sink associated with this folder.
- --organization=ORGANIZATION_ID
-
Create a sink associated with this organization.
-
GCLOUD WIDE FLAGS
These flags are available to all commands: --account, --configuration, --flags-file, --flatten, --format, --help, --log-http, --project, --quiet, --trace-token, --user-output-enabled, --verbosity. Run $ gcloud help for details.
EXAMPLES
To export all Google Compute Engine logs to BigQuery, run:
-
$ gcloud beta logging sinks create my-bq-sink \
bigquery.googleapis.com/projects/my-project/datasets/\ my_dataset --log-filter='resource.type="gce_instance"'
To export "syslog" from App Engine Flexible to Cloud Storage, run:
-
$ gcloud beta logging sinks create my-gcs-sink \
storage.googleapis.com/my-bucket \
--log-filter='logName="projects/my-project/appengine.googleapis.\ com%2Fsyslog"'
To export Google App Engine logs with ERROR severity, run:
-
$ gcloud beta logging sinks create my-error-logs \
bigquery.googleapis.com/projects/my-project/datasets/\ my_dataset --log-filter='resource.type="gae_app" AND severity=ERROR'
Detailed information about filters can be found at: cloud.google.com/logging/docs/view/advanced_filters
NOTES
This command is currently in BETA and may change without notice. This variant is also available:
- $ gcloud logging sinks create