gcloud logging read [LOG_FILTER] [--freshness=FRESHNESS; default="1d"] [--order=ORDER; default="desc"] [--billing-account=BILLING_ACCOUNT_ID | --folder=FOLDER_ID | --organization=ORGANIZATION_ID | --project=PROJECT_ID] [--resource-names=[RESOURCE,…] | --bucket=BUCKET --location=LOCATION --view=VIEW] [--limit=LIMIT] [GCLOUD_WIDE_FLAG …]
log-filter are returned in order of decreasing timestamps,
most-recent entries first. If the log entries come from multiple logs, then
entries from different logs might be intermingled in the results.
gcloud logging read "resource.type=gce_instance"To read log entries with severity ERROR or higher, run:
gcloud logging read "severity>=ERROR"To read log entries written in a specific time window, run:
gcloud logging read 'timestamp<="2015-05-31T23:59:59Z" AND
timestamp>="2015-05-31T00:00:00Z"'
To read up to 10 log entries in your project's syslog log from Compute Engine
instances containing payloads that include the word SyncAddress and
format the output in JSON format, run:
gcloud logging read "resource.type=gce_instance AND logName=projects/[PROJECT_ID]/logs/syslog AND textPayload:SyncAddress" --limit=10 --format=jsonTo read a log entry from a folder, run:
gcloud logging read "resource.type=global" --folder=[FOLDER_ID] --limit=1To read a log entry from a global log bucket, run:
gcloud logging read --bucket=<bucket-id> --location=[LOCATION] --limit=1
To read a log entry from the global _Required log bucket using the
bucket's _Default log view:
gcloud logging read "" --bucket=_Required --location=global --view=_Default --limit=1
To read a log entry from a log bucket using the bucket's _AllLogs
log view:
gcloud logging read "" --bucket=[BUCKET_ID] --location=[LOCATION] --view=_AllLogs --limit=1To read a log entry from a log bucket using a custom log view that you have created for the bucket:
gcloud logging read "" --bucket=[BUCKET_ID] --location=[LOCATION] --view=[VIEW_ID] --limit=1To read log entries from multiple resources, specify them as a comma-delimeted sequence with --resource-names. Each resource name can be specified either as a top-level resource (e.g., projects/[PROJECT_ID], folders/[FOLDER_ID], etc.) or as a Log View resource (e.g., projects/[PROJECT_ID]/locations/[LOCATION]/buckets/[BUCKET_NAME]/views/[VIEW_ID]).
gcloud logging read "" --resource-names=[RESOURCE-1],[RESOURCE-2]LOG_FILTER]--freshness=FRESHNESS; default="1d"--order=ORDER; default="desc"ORDER must be one of: desc,
asc.
--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.
At most one of these can be specified:
--resource-names=[RESOURCE,…]--bucket=BUCKET--location
and --view must also be specified.
This flag argument must be specified if any of the other arguments in this group
are specified.
--location=LOCATION--bucket and --view must also be specified.
This flag argument must be specified if any of the other arguments in this group
are specified.
--view=VIEW--location and
--bucket must also be specified.
This flag argument must be specified if any of the other arguments in this group
are specified.
--limit=LIMITunlimited. This
flag interacts with other flags that are applied in this order:
--flatten, --sort-by, --filter,
--limit.
--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 readgcloud beta logging read
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.