- NAME
-
- gcloud logging scopes create - create a log scope
- SYNOPSIS
-
-
gcloud logging scopes create
LOG_SCOPE_ID
--resource-names
=[RESOURCE_NAMES
,…] [--description
=DESCRIPTION
] [--folder
=FOLDER_ID
|--organization
=ORGANIZATION_ID
|--project
=PROJECT_ID
] [GCLOUD_WIDE_FLAG …
]
-
- DESCRIPTION
- After creating a log scope, you can use it to view logs in 1 or more resources.
- EXAMPLES
-
To create a log scope in a project, run:
gcloud logging scopes create my-scope --resource-names=projects/my-project
To create a log scope in a project with a description, run:
gcloud logging scopes create my-scope --resource-names=projects/my-project --description="my
custom log scope"To create a log scope that contains more than 1 resource, such as projects and views, run:
gcloud logging scopes create my-scope --resource-names=projects/my-project,projects/my-project2, projects/my-project/locations/global/buckets/my-bucket/views/my-view1, projects/my-project/locations/global/buckets/my-bucket/views/my-view2,
- POSITIONAL ARGUMENTS
-
LOG_SCOPE_ID
- ID of the log scope to create.
- REQUIRED FLAGS
-
--resource-names
=[RESOURCE_NAMES
,…]-
Comma-separated list of resource names in this log scope. It could be one or
more parent resources or one or more views. A log scope can include a maximum of
50 projects and a maximum of 100 resources in total. For example,
projects/[PROJECT_ID],
projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]
- OPTIONAL FLAGS
-
--description
=DESCRIPTION
- A textual description for the log scope.
-
At most one of these can be specified:
--folder
=FOLDER_ID
- Folder of the log scope to create.
--organization
=ORGANIZATION_ID
- Organization of the log scope to create.
--project
=PROJECT_ID
-
Project of the log scope 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
gcloud config list --format='text(core.project)'
and can be set usinggcloud config set project PROJECTID
.--project
and its fallbackcore/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
orbilling/quota_project
property.
- 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
$ gcloud help
for details.
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 2024-10-22 UTC.