Stay organized with collections Save and categorize content based on your preferences.
gcloud logging sinks create
SINK_NAME
DESTINATION
[--custom-writer-identity
=SERVICE_ACCOUNT_EMAIL
] [--description
=DESCRIPTION
] [--disabled
] [--exclusion
=[description
=DESCRIPTION
],[disabled
=DISABLED
],[filter
=FILTER
],[name
=NAME
]] [--include-children
] [--intercept-children
] [--log-filter
=LOG_FILTER
] [--use-partitioned-tables
] [--billing-account
=BILLING_ACCOUNT_ID
| --folder
=FOLDER_ID
| --organization
=ORGANIZATION_ID
| --project
=PROJECT_ID
] [GCLOUD_WIDE_FLAG …
]
--log-filter
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.
gcloud logging sinks create my-bq-sink bigquery.googleapis.com/projects/my-project/datasets/my_dataset --log-filter='resource.type="gce_instance"'
To route "syslog" from App Engine Flexible to a Cloud Storage bucket, run:
gcloud logging sinks create my-gcs-sink storage.googleapis.com/my-bucket --log-filter='logName="projects/my-project/appengine.googleapis.com%2Fsyslog"'
To route Google App Engine logs with ERROR severity, run:
gcloud logging sinks create my-error-logs bigquery.googleapis.com/projects/my-project/datasets/my_dataset --log-filter='resource.type="gae_app" AND severity=ERROR'
To route all logs to a log bucket in a different project, run:
gcloud logging sinks create my-sink logging.googleapis.com/projects/my-central-project/locations/global/buckets/my-central-bucket
To route all logs to another project, run:
gcloud logging sinks create my-sink logging.googleapis.com/projects/my-destination-project
SINK_NAME
DESTINATION
--custom-writer-identity
=SERVICE_ACCOUNT_EMAIL
--description
=DESCRIPTION
--disabled
--exclusion
=[description
=DESCRIPTION
],[disabled
=DISABLED
],[filter
=FILTER
],[name
=NAME
]
The
and name
attributes are required. The following keys are accepted:filter
name
load-balancer-exclusion
. Identifiers are limited to 100 characters and can include only letters, digits, underscores, hyphens, and periods.
description
filter
disabled
--include-children
--intercept-children
--log-filter
=LOG_FILTER
--use-partitioned-tables
--billing-account
=BILLING_ACCOUNT_ID
--folder
=FOLDER_ID
--organization
=ORGANIZATION_ID
--project
=PROJECT_ID
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 gcloud config list --format='text(core.project)'
and can be set using gcloud config set project PROJECTID
.
--project
and its fallback core/project
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 --billing-project
or billing/quota_project
property.
--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 $ gcloud help
for details.
gcloud alpha logging sinks create
gcloud beta logging sinks create
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-05-07 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-05-07 UTC."],[],[]]
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4