HEX
Server: Apache/2.4.65 (Ubuntu)
System: Linux ielts-store-v2 6.8.0-1036-gcp #38~22.04.1-Ubuntu SMP Thu Aug 14 01:19:18 UTC 2025 x86_64
User: root (0)
PHP: 7.2.34-54+ubuntu20.04.1+deb.sury.org+1
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,
Upload Files
File: //snap/google-cloud-cli/394/help/man/man1/gcloud_beta_logging_sinks_create.1
.TH "GCLOUD_BETA_LOGGING_SINKS_CREATE" 1



.SH "NAME"
.HP
gcloud beta logging sinks create \- create a log sink



.SH "SYNOPSIS"
.HP
\f5gcloud beta logging sinks create\fR \fISINK_NAME\fR \fIDESTINATION\fR [\fB\-\-custom\-writer\-identity\fR=\fISERVICE_ACCOUNT_EMAIL\fR] [\fB\-\-description\fR=\fIDESCRIPTION\fR] [\fB\-\-disabled\fR] [\fB\-\-exclusion\fR=[\fIdescription\fR=\fIDESCRIPTION\fR],[\fIdisabled\fR=\fIDISABLED\fR],[\fIfilter\fR=\fIFILTER\fR],[\fIname\fR=\fINAME\fR]] [\fB\-\-include\-children\fR] [\fB\-\-intercept\-children\fR] [\fB\-\-log\-filter\fR=\fILOG_FILTER\fR] [\fB\-\-use\-partitioned\-tables\fR] [\fB\-\-billing\-account\fR=\fIBILLING_ACCOUNT_ID\fR\ |\ \fB\-\-folder\fR=\fIFOLDER_ID\fR\ |\ \fB\-\-organization\fR=\fIORGANIZATION_ID\fR\ |\ \fB\-\-project\fR=\fIPROJECT_ID\fR] [\fIGCLOUD_WIDE_FLAG\ ...\fR]



.SH "DESCRIPTION"

\fB(BETA)\fR Create a log sink used to route log entries to a destination. The
sink routes all log entries that match its \fB\-\-log\-filter\fR flag.

An empty filter matches all logs.

Detailed information about filters can be found at:
https://cloud.google.com/logging/docs/view/logging\-query\-language

The sink's destination can be a Cloud Logging log bucket, a Cloud Storage
bucket, a BigQuery dataset, a Cloud Pub/Sub topic, or a Google Cloud project.

The destination must already exist.

If creating a log sink to route logs to a destination outside of Cloud Logging
or to a Cloud Logging log bucket in another project, the log sink's service
account must be granted permission to write to the destination.

For more information about destination permissions, see:
https://cloud.google.com/logging/docs/export/configure_export_v2#dest\-auth

Matching log entries are routed to the destination after the sink is created.



.SH "EXAMPLES"

To route all Google Compute Engine logs to BigQuery, run:

.RS 2m
$ gcloud beta logging sinks create my\-bq\-sink \e
    bigquery.googleapis.com/projects/my\-project/datasets/\e
my_dataset \-\-log\-filter='resource.type="gce_instance"'
.RE

To route "syslog" from App Engine Flexible to a Cloud Storage bucket, run:

.RS 2m
$ gcloud beta logging sinks create my\-gcs\-sink \e
    storage.googleapis.com/my\-bucket \e
    \-\-log\-filter='logName="projects/my\-project/appengine.googleapis.\e
com%2Fsyslog"'
.RE

To route Google App Engine logs with ERROR severity, run:

.RS 2m
$ gcloud beta logging sinks create my\-error\-logs \e
    bigquery.googleapis.com/projects/my\-project/datasets/\e
my_dataset \-\-log\-filter='resource.type="gae_app" AND severity=ERROR'
.RE

To route all logs to a log bucket in a different project, run:

.RS 2m
$ gcloud beta logging sinks create my\-sink \e
    logging.googleapis.com/projects/my\-central\-project/locations/\e
global/buckets/my\-central\-bucket
.RE

To route all logs to another project, run:

.RS 2m
$ gcloud beta logging sinks create my\-sink \e
    logging.googleapis.com/projects/my\-destination\-project
.RE



.SH "POSITIONAL ARGUMENTS"

.RS 2m
.TP 2m
\fISINK_NAME\fR

The name for the sink.

.TP 2m
\fIDESTINATION\fR

The destination for the sink.


.RE
.sp

.SH "FLAGS"

.RS 2m
.TP 2m
\fB\-\-custom\-writer\-identity\fR=\fISERVICE_ACCOUNT_EMAIL\fR

Writer identity for the sink. This flag can only be used if the destination is a
log bucket in a different project. The writer identity is automatically
generated when it is not provided for a sink.

.TP 2m
\fB\-\-description\fR=\fIDESCRIPTION\fR

Description of the sink.

.TP 2m
\fB\-\-disabled\fR

Sink will be disabled. Disabled sinks do not export logs.

.TP 2m
\fB\-\-exclusion\fR=[\fIdescription\fR=\fIDESCRIPTION\fR],[\fIdisabled\fR=\fIDISABLED\fR],[\fIfilter\fR=\fIFILTER\fR],[\fIname\fR=\fINAME\fR]

Specify an exclusion filter for a log entry that is not to be exported. This
flag can be repeated.

The \f5\fIname\fR\fR and \f5\fIfilter\fR\fR attributes are required. The
following keys are accepted:

.RS 2m
.TP 2m
\fBname\fR
An identifier, such as \f5\fIload\-balancer\-exclusion\fR\fR. Identifiers are
limited to 100 characters and can include only letters, digits, underscores,
hyphens, and periods.

.TP 2m
\fBdescription\fR
A description of this exclusion.

.TP 2m
\fBfilter\fR
An advanced log filter that matches the log entries to be excluded.

.TP 2m
\fBdisabled\fR
If this exclusion should be disabled and not exclude the log entries.

.RE
.sp
.TP 2m
\fB\-\-include\-children\fR

Whether to export logs from all child projects and folders. Only applies to
sinks for organizations and folders.

.TP 2m
\fB\-\-intercept\-children\fR

Whether to intercept logs from all child projects and folders. Only applies to
sinks for organizations and folders.

.TP 2m
\fB\-\-log\-filter\fR=\fILOG_FILTER\fR

A filter expression for the sink. If present, the filter specifies which log
entries to export.

.TP 2m

Settings for sink exporting data to BigQuery.


.RS 2m
.TP 2m
\fB\-\-use\-partitioned\-tables\fR

If specified, use BigQuery's partitioned tables. By default, Logging creates
dated tables based on the log entries' timestamps, e.g. 'syslog_20170523'.
Partitioned tables remove the suffix and special query syntax
(https://cloud.google.com/bigquery/docs/querying\-partitioned\-tables) must be
used.

.RE
.sp
.TP 2m

At most one of these can be specified:


.RS 2m
.TP 2m
\fB\-\-billing\-account\fR=\fIBILLING_ACCOUNT_ID\fR

Billing account of the sink to create.

.TP 2m
\fB\-\-folder\fR=\fIFOLDER_ID\fR

Folder of the sink to create.

.TP 2m
\fB\-\-organization\fR=\fIORGANIZATION_ID\fR

Organization of the sink to create.

.TP 2m
\fB\-\-project\fR=\fIPROJECT_ID\fR

Project of the sink to create.

The Google Cloud project ID to use for this invocation. If omitted, then the
current project is assumed; the current project can be listed using \f5gcloud
config list \-\-format='text(core.project)'\fR and can be set using \f5gcloud
config set project PROJECTID\fR.

\f5\-\-project\fR and its fallback \f5core/project\fR property play two roles in
the invocation. It specifies the project of the resource to operate on. It also
specifies the project for API enablement check, quota, and billing. To specify a
different project for quota and billing, use \f5\-\-billing\-project\fR or
\f5billing/quota_project\fR property.


.RE
.RE
.sp

.SH "GCLOUD WIDE FLAGS"

These flags are available to all commands: \-\-access\-token\-file, \-\-account,
\-\-billing\-project, \-\-configuration, \-\-flags\-file, \-\-flatten,
\-\-format, \-\-help, \-\-impersonate\-service\-account, \-\-log\-http,
\-\-project, \-\-quiet, \-\-trace\-token, \-\-user\-output\-enabled,
\-\-verbosity.

Run \fB$ gcloud help\fR for details.



.SH "NOTES"

This command is currently in beta and might change without notice. These
variants are also available:

.RS 2m
$ gcloud logging sinks create
.RE

.RS 2m
$ gcloud alpha logging sinks create
.RE