recent_queries
Creates, updates, deletes, gets or lists a recent_queries resource.
Overview
| Name | recent_queries |
| Type | Resource |
| Id | google.logging.recent_queries |
Fields
The following fields are returned by SELECT queries:
- projects_locations_recent_queries_list
- organizations_locations_recent_queries_list
- folders_locations_recent_queries_list
- billing_accounts_locations_recent_queries_list
| Name | Datatype | Description |
|---|---|---|
name | string | Optional. 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. |
lastRunTime | string (google-datetime) | Output only. The timestamp when this query was last run. |
loggingQuery | object | Logging query that can be executed in Logs Explorer or via Logging API. (id: LoggingQuery) |
opsAnalyticsQuery | object | Analytics query that can be executed in Log Analytics. (id: OpsAnalyticsQuery) |
| Name | Datatype | Description |
|---|---|---|
name | string | Optional. 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. |
lastRunTime | string (google-datetime) | Output only. The timestamp when this query was last run. |
loggingQuery | object | Logging query that can be executed in Logs Explorer or via Logging API. (id: LoggingQuery) |
opsAnalyticsQuery | object | Analytics query that can be executed in Log Analytics. (id: OpsAnalyticsQuery) |
| Name | Datatype | Description |
|---|---|---|
name | string | Optional. 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. |
lastRunTime | string (google-datetime) | Output only. The timestamp when this query was last run. |
loggingQuery | object | Logging query that can be executed in Logs Explorer or via Logging API. (id: LoggingQuery) |
opsAnalyticsQuery | object | Analytics query that can be executed in Log Analytics. (id: OpsAnalyticsQuery) |
| Name | Datatype | Description |
|---|---|---|
name | string | Optional. 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. |
lastRunTime | string (google-datetime) | Output only. The timestamp when this query was last run. |
loggingQuery | object | Logging query that can be executed in Logs Explorer or via Logging API. (id: LoggingQuery) |
opsAnalyticsQuery | object | Analytics query that can be executed in Log Analytics. (id: OpsAnalyticsQuery) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
projects_locations_recent_queries_list | select | projectsId, locationsId | pageToken, pageSize, filter | Lists the RecentQueries that were created by the user making the request. |
organizations_locations_recent_queries_list | select | organizationsId, locationsId | pageToken, pageSize, filter | Lists the RecentQueries that were created by the user making the request. |
folders_locations_recent_queries_list | select | foldersId, locationsId | pageToken, pageSize, filter | Lists the RecentQueries that were created by the user making the request. |
billing_accounts_locations_recent_queries_list | select | billingAccountsId, locationsId | pageToken, pageSize, filter | Lists 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.
| Name | Datatype | Description |
|---|---|---|
billingAccountsId | string | |
foldersId | string | |
locationsId | string | |
organizationsId | string | |
projectsId | string | |
filter | string | |
pageSize | integer (int32) | |
pageToken | string |
SELECT examples
- projects_locations_recent_queries_list
- organizations_locations_recent_queries_list
- folders_locations_recent_queries_list
- billing_accounts_locations_recent_queries_list
Lists the RecentQueries that were created by the user making the request.
SELECT
name,
lastRunTime,
loggingQuery,
opsAnalyticsQuery
FROM google.logging.recent_queries
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND pageToken = '{{ pageToken }}'
AND pageSize = '{{ pageSize }}'
AND filter = '{{ filter }}'
;
Lists the RecentQueries that were created by the user making the request.
SELECT
name,
lastRunTime,
loggingQuery,
opsAnalyticsQuery
FROM google.logging.recent_queries
WHERE organizationsId = '{{ organizationsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND pageToken = '{{ pageToken }}'
AND pageSize = '{{ pageSize }}'
AND filter = '{{ filter }}'
;
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 }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND pageToken = '{{ pageToken }}'
AND pageSize = '{{ pageSize }}'
AND filter = '{{ filter }}'
;
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 pageToken = '{{ pageToken }}'
AND pageSize = '{{ pageSize }}'
AND filter = '{{ filter }}'
;