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

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://cloud.google.com/logging/docs/region-support)The QUERY_ID is a system generated alphanumeric ID.
lastRunTimestringOutput only. The timestamp when this query was last run.
loggingQueryobjectDescribes a Cloud Logging query that can be run in Logs Explorer UI or via the logging API.In addition to the query itself, additional information may be stored to capture the display configuration and other UI state used in association with analysis of query results.
opsAnalyticsQueryobjectDescribes an analytics query that can be run in the Log Analytics page of Google Cloud console.Preview: This is a preview feature and may be subject to change before final release.

Methods

NameAccessible byRequired ParamsDescription
billing_accounts_locations_recent_queries_listSELECTbillingAccountsId, locationsIdLists the RecentQueries that were created by the user making the request.
folders_locations_recent_queries_listSELECTfoldersId, locationsIdLists the RecentQueries that were created by the user making the request.
organizations_locations_recent_queries_listSELECTlocationsId, organizationsIdLists the RecentQueries that were created by the user making the request.
projects_locations_recent_queries_listSELECTlocationsId, projectsIdLists the RecentQueries that were created by the user making the request.

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 foldersId = '{{ foldersId }}'
AND locationsId = '{{ locationsId }}';