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/current/help/man/man1/gcloud_logging_metrics_update.1
.TH "GCLOUD_LOGGING_METRICS_UPDATE" 1



.SH "NAME"
.HP
gcloud logging metrics update \- update the definition of a logs\-based metric



.SH "SYNOPSIS"
.HP
\f5gcloud logging metrics update\fR \fIMETRIC_NAME\fR (\fB\-\-config\-from\-file\fR=\fIPATH_TO_FILE\fR\ |\ \fB\-\-bucket\-name\fR=\fIBUCKET_NAME\fR\ \fB\-\-description\fR=\fIDESCRIPTION\fR\ \fB\-\-log\-filter\fR=\fILOG_FILTER\fR) [\fIGCLOUD_WIDE_FLAG\ ...\fR]



.SH "DESCRIPTION"

Update the description or the filter expression of an existing logs\-based
metric.



.SH "EXAMPLES"

To update the description of a metric called high_severity_count, run:

.RS 2m
$ gcloud logging metrics update high_severity_count \e
    \-\-description="Count of high\-severity log entries."
.RE

To update the filter expression of the metric, run:

.RS 2m
$ gcloud logging metrics update high_severity_count \e
    \-\-log\-filter="severity >= WARNING"
.RE

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

For advanced features such as user\-defined labels and distribution metrics,
update using a config file:

.RS 2m
$ gcloud logging metrics update high_severity_count \e
    \-\-config\-from\-file=$PATH_TO_FILE
.RE

The config file should be in YAML format. Detailed information about how to
configure metrics can be found at:
https://cloud.google.com/logging/docs/reference/v2/rest/v2/projects.metrics#LogMetric.
Any top\-level fields in the LogMetric definition that aren't specified in the
config file will not be updated in the metric.

To update the bucket associated with a bucket log\-based metric, run:

.RS 2m
$ gcloud logging metrics update my\-bucket\-metric \e
    \-\-bucket\-name="NEW_BUCKET_NAME"
.RE



.SH "POSITIONAL ARGUMENTS"

.RS 2m
.TP 2m
\fIMETRIC_NAME\fR

The name of the log\-based metric to update.


.RE
.sp

.SH "REQUIRED FLAGS"

.RS 2m
.TP 2m

Data about the metric to update.

Exactly one of these must be specified:


.RS 2m
.TP 2m
\fB\-\-config\-from\-file\fR=\fIPATH_TO_FILE\fR

A path to a YAML file specifying the updates to be made to the logs\-based
metric. Use a full or relative path to a local file containing the value of
config.

.TP 2m

Arguments to specify information about simple counter logs\-based metrics.


.RS 2m
.TP 2m
\fB\-\-bucket\-name\fR=\fIBUCKET_NAME\fR

The Log Bucket name which owns the log\-based metric.

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

A new description for the metric. If omitted, the description is not changed.

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

A new filter string for the metric. If omitted, the filter is not changed.


.RE
.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"

These variants are also available:

.RS 2m
$ gcloud alpha logging metrics update
.RE

.RS 2m
$ gcloud beta logging metrics update
.RE