Skip to main content

recent_queries

Creates, updates, deletes, gets or lists a recent_queries resource.

Overview​

Namerecent_queries
TypeResource
Idgoogle.logging.recent_queries

Fields​

The following fields are returned by SELECT queries:

NameDatatypeDescription
namestringOutput only. Resource name of the recent query.In the format: "projects/[PROJECT_ID]/locations/[LOCATION_ID]/recentQueries/[QUERY_ID]" For a list of supported locations, see Supported Regions (https://docs.cloud.google.com/logging/docs/region-support)The QUERY_ID is a system generated alphanumeric ID.
lastRunTimestring (google-datetime)Output only. The timestamp when this query was last run.
loggingQueryobjectLogging query that can be executed in Logs Explorer or via Logging API. (id: LoggingQuery)
opsAnalyticsQueryobjectAnalytics query that can be executed in Log Analytics. (id: OpsAnalyticsQuery)

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
billing_accounts_locations_recent_queries_listselectbillingAccountsId, locationsIdfilter, pageSize, pageTokenLists the RecentQueries that were created by the user making the request.
folders_locations_recent_queries_listselectfoldersId, locationsIdfilter, pageSize, pageTokenLists the RecentQueries that were created by the user making the request.
organizations_locations_recent_queries_listselectorganizationsId, locationsIdfilter, pageSize, pageTokenLists the RecentQueries that were created by the user making the request.
projects_locations_recent_queries_listselectprojectsId, locationsIdfilter, pageSize, pageTokenLists the RecentQueries that were created by the user making the request.

Parameters​

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
billingAccountsIdstring
foldersIdstring
locationsIdstring
organizationsIdstring
projectsIdstring
filterstring
pageSizeinteger (int32)
pageTokenstring

SELECT examples​

Lists the RecentQueries that were created by the user making the request.

SELECT
name,
lastRunTime,
loggingQuery,
opsAnalyticsQuery
FROM google.logging.recent_queries
WHERE billingAccountsId = '{{ billingAccountsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND filter = '{{ filter }}'
AND pageSize = '{{ pageSize }}'
AND pageToken = '{{ pageToken }}'
;