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/396/help/man/man1/gcloud_policy-intelligence_query-activity.1
.TH "GCLOUD_POLICY\-INTELLIGENCE_QUERY\-ACTIVITY" 1



.SH "NAME"
.HP
gcloud policy\-intelligence query\-activity \- query activities on cloud resource



.SH "SYNOPSIS"
.HP
\f5gcloud policy\-intelligence query\-activity\fR \fB\-\-activity\-type\fR=\fIACTIVITY_TYPE\fR \fB\-\-project\fR=\fIPROJECT\fR [\fB\-\-limit\fR=\fILIMIT\fR;\ default=1000] [\fB\-\-page\-size\fR=\fIPAGE_SIZE\fR;\ default=500] [\fB\-\-query\-filter\fR=\fIQUERY_FILTER\fR] [\fIGCLOUD_WIDE_FLAG\ ...\fR]



.SH "DESCRIPTION"

Query activities with certain types of specific container resource. For
\-\-activity\-type, supported values are:
.RS 2m
.IP "\(bu" 2m
serviceAccountLastAuthentication
.IP "\(bu" 2m
serviceAccountKeyLastAuthentication
.RE
.sp



.SH "EXAMPLES"

To query serviceAccountKeyLastAuthentication activities of a project, run:

.RS 2m
$ gcloud policy\-intelligence query\-activity \e
    \-\-activity\-type=serviceAccountKeyLastAuthentication \e
    \-\-project=project\-id
.RE

To query serviceAccountLastAuthentication activities of a project with no limit,
run:

.RS 2m
$ gcloud policy\-intelligence query\-activity \e
    \-\-activity\-type=serviceAccountLastAuthentication \e
    \-\-project=project\-id \-\-limit=unlimited
.RE

To query serviceAccountLastAuthentication with filtering on certain service
account, run:

.RS 2m
$ gcloud policy\-intelligence query\-activity \e
    \-\-activity\-type=serviceAccountLastAuthentication \e
    \-\-project=project\-id \e
    \-\-query\-filter='activities.full_resource_name="//iam.googleapis.\e
com/projects/project\-id/serviceAccounts/service\-account\-name@project\e
\-id.iam.gserviceaccount.com"'
.RE

To query serviceAccountLastAuthentication with filtering on multiple service
accounts, run:

.RS 2m
$ gcloud policy\-intelligence query\-activity \e
    \-\-activity\-type=serviceAccountLastAuthentication \e
    \-\-project=project\-id \e
    \-\-query\-filter='activities.full_resource_name="//iam.googleapis.\e
com/projects/project\-id/serviceAccounts/service\-account\-name\-1@proje\e
ct\-id.iam.gserviceaccount.com" OR
 activities.full_resource_name="//iam.googleapis.com/projects/projec\e
t\-id/serviceAccounts/service\-account\-name\-2@project\-id.iam.gservicea\e
ccount.com" OR
 activities.full_resource_name="//iam.googleapis.com/projects/projec\e
t\-id/serviceAccounts/service\-account\-name\-3@project\-id.iam.gservicea\e
ccount.com"'
.RE



.SH "REQUIRED FLAGS"

.RS 2m
.TP 2m
\fB\-\-activity\-type\fR=\fIACTIVITY_TYPE\fR

Type of the activities. \fIACTIVITY_TYPE\fR must be one of:
\fBserviceAccountLastAuthentication\fR,
\fBserviceAccountKeyLastAuthentication\fR.

.TP 2m
\fB\-\-project\fR=\fIPROJECT\fR

The project ID or number to query the activities.


.RE
.sp

.SH "OPTIONAL FLAGS"

.RS 2m
.TP 2m
\fB\-\-limit\fR=\fILIMIT\fR; default=1000

Max number of query result. Default to be 1000 and max to be unlimited, i.e.,
\-\-limit=unlimited.

.TP 2m
\fB\-\-page\-size\fR=\fIPAGE_SIZE\fR; default=500

Max page size for each http response. Default to be 500 and max to be 1000.

.TP 2m
\fB\-\-query\-filter\fR=\fIQUERY_FILTER\fR

Filter on activities, separated by "OR" if multiple filters are specified. At
most 10 filter restrictions are supported in the query\-filter. e.g.
\-\-query\-filter='activities.full_resource_name="//iam.googleapis.com/projects/project\-id/serviceAccounts/service\-account\-name\-1@project\-id.iam.gserviceaccount.com"
OR
activities.full_resource_name="//iam.googleapis.com/projects/project\-id/serviceAccounts/service\-account\-name\-2@project\-id.iam.gserviceaccount.com"'


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