gcloud logging buckets update BUCKET_ID --location=LOCATION [--add-index=[KEY=VALUE, …,…]] [--async] [--clear-indexes] [--cmek-kms-key-name=CMEK_KMS_KEY_NAME] [--description=DESCRIPTION] [--enable-analytics] [--locked] [--remove-indexes=[FIELD PATH,…]] [--restricted-fields=[RESTRICTED_FIELD,…]] [--retention-days=RETENTION_DAYS] [--update-index=[KEY=VALUE, …,…]] [--billing-account=BILLING_ACCOUNT_ID | --folder=FOLDER_ID | --organization=ORGANIZATION_ID | --project=PROJECT_ID] [GCLOUD_WIDE_FLAG …]
gcloud logging buckets update my-bucket --location=global --description=my-new-descriptionTo update a bucket in your project and remove all indexes, run:
gcloud logging buckets update my-bucket --location=global --clear-indexesTo update a bucket in your project and remove an index, run:
gcloud logging buckets update my-bucket --location=global --remove-indexes=jsonPayload.foo2To update a bucket in your project and add an index, run:
gcloud logging buckets update my-bucket --location=global --add-index=fieldPath=jsonPayload.foo2,type=INDEX_TYPE_STRINGTo update a bucket in your project and update an existing index, run:
gcloud logging buckets update my-bucket --location=global --update-index=fieldPath=jsonPayload.foo,type=INDEX_TYPE_INTEGERTo update a bucket in your project and update existing cmek, run:
gcloud logging buckets update my-bucket --location=global --cmek-kms-key-name=CMEK_KEY_NAMETo asynchronously enroll a bucket in your project into Log Analytics, run:
gcloud logging buckets update my-bucket --location=global --async --enable-analyticsBUCKET_ID--location=LOCATION--add-index=[KEY=VALUE, …,…]fieldPath and
type attributes are required. For example:
--index=fieldPath=jsonPayload.foo,type=INDEX_TYPE_STRING. The following keys are
accepted:
fieldPathtype--async--clear-indexes--cmek-kms-key-name=CMEK_KMS_KEY_NAMEkms_key_name will enable CMEK for the bucket.
--description=DESCRIPTION--enable-analytics--locked--remove-indexes=[FIELD PATH,…]--restricted-fields=[RESTRICTED_FIELD,…]--retention-days=RETENTION_DAYS--update-index=[KEY=VALUE, …,…]fieldPath and
type attributes are required. For example:
--index=fieldPath=jsonPayload.foo,type=INDEX_TYPE_STRING. The following keys are
accepted:
fieldPathtype--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 buckets updategcloud beta logging buckets update
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 2026-05-27 UTC.