saved_queries
Creates, updates, deletes, gets or lists a saved_queries
resource.
Overview
Name | saved_queries |
Type | Resource |
Id | google.logging.saved_queries |
Fields
The following fields are returned by SELECT
queries:
- projects_locations_saved_queries_get
- organizations_locations_saved_queries_get
- folders_locations_saved_queries_get
- billing_accounts_locations_saved_queries_get
- projects_locations_saved_queries_list
- organizations_locations_saved_queries_list
- folders_locations_saved_queries_list
- billing_accounts_locations_saved_queries_list
Successful response
Name | Datatype | Description |
---|---|---|
name | string | Output only. Resource name of the saved query.In the format: "projects/[PROJECT_ID]/locations/[LOCATION_ID]/savedQueries/[QUERY_ID]" For a list of supported locations, see Supported Regions (https://cloud.google.com/logging/docs/region-support#bucket-regions)After the saved query is created, the location cannot be changed.If the user doesn't provide a QUERY_ID, the system will generate an alphanumeric ID. |
createTime | string (google-datetime) | Output only. The timestamp when the saved query was created. |
description | string | Optional. A human readable description of the saved query. |
displayName | string | Required. The user specified title for the SavedQuery. |
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) |
updateTime | string (google-datetime) | Output only. The timestamp when the saved query was last updated. |
visibility | string | Required. The visibility status of this query, which determines its ownership. |
Successful response
Name | Datatype | Description |
---|---|---|
name | string | Output only. Resource name of the saved query.In the format: "projects/[PROJECT_ID]/locations/[LOCATION_ID]/savedQueries/[QUERY_ID]" For a list of supported locations, see Supported Regions (https://cloud.google.com/logging/docs/region-support#bucket-regions)After the saved query is created, the location cannot be changed.If the user doesn't provide a QUERY_ID, the system will generate an alphanumeric ID. |
createTime | string (google-datetime) | Output only. The timestamp when the saved query was created. |
description | string | Optional. A human readable description of the saved query. |
displayName | string | Required. The user specified title for the SavedQuery. |
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) |
updateTime | string (google-datetime) | Output only. The timestamp when the saved query was last updated. |
visibility | string | Required. The visibility status of this query, which determines its ownership. |
Successful response
Name | Datatype | Description |
---|---|---|
name | string | Output only. Resource name of the saved query.In the format: "projects/[PROJECT_ID]/locations/[LOCATION_ID]/savedQueries/[QUERY_ID]" For a list of supported locations, see Supported Regions (https://cloud.google.com/logging/docs/region-support#bucket-regions)After the saved query is created, the location cannot be changed.If the user doesn't provide a QUERY_ID, the system will generate an alphanumeric ID. |
createTime | string (google-datetime) | Output only. The timestamp when the saved query was created. |
description | string | Optional. A human readable description of the saved query. |
displayName | string | Required. The user specified title for the SavedQuery. |
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) |
updateTime | string (google-datetime) | Output only. The timestamp when the saved query was last updated. |
visibility | string | Required. The visibility status of this query, which determines its ownership. |
Successful response
Name | Datatype | Description |
---|---|---|
name | string | Output only. Resource name of the saved query.In the format: "projects/[PROJECT_ID]/locations/[LOCATION_ID]/savedQueries/[QUERY_ID]" For a list of supported locations, see Supported Regions (https://cloud.google.com/logging/docs/region-support#bucket-regions)After the saved query is created, the location cannot be changed.If the user doesn't provide a QUERY_ID, the system will generate an alphanumeric ID. |
createTime | string (google-datetime) | Output only. The timestamp when the saved query was created. |
description | string | Optional. A human readable description of the saved query. |
displayName | string | Required. The user specified title for the SavedQuery. |
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) |
updateTime | string (google-datetime) | Output only. The timestamp when the saved query was last updated. |
visibility | string | Required. The visibility status of this query, which determines its ownership. |
Successful response
Name | Datatype | Description |
---|---|---|
name | string | Output only. Resource name of the saved query.In the format: "projects/[PROJECT_ID]/locations/[LOCATION_ID]/savedQueries/[QUERY_ID]" For a list of supported locations, see Supported Regions (https://cloud.google.com/logging/docs/region-support#bucket-regions)After the saved query is created, the location cannot be changed.If the user doesn't provide a QUERY_ID, the system will generate an alphanumeric ID. |
createTime | string (google-datetime) | Output only. The timestamp when the saved query was created. |
description | string | Optional. A human readable description of the saved query. |
displayName | string | Required. The user specified title for the SavedQuery. |
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) |
updateTime | string (google-datetime) | Output only. The timestamp when the saved query was last updated. |
visibility | string | Required. The visibility status of this query, which determines its ownership. |
Successful response
Name | Datatype | Description |
---|---|---|
name | string | Output only. Resource name of the saved query.In the format: "projects/[PROJECT_ID]/locations/[LOCATION_ID]/savedQueries/[QUERY_ID]" For a list of supported locations, see Supported Regions (https://cloud.google.com/logging/docs/region-support#bucket-regions)After the saved query is created, the location cannot be changed.If the user doesn't provide a QUERY_ID, the system will generate an alphanumeric ID. |
createTime | string (google-datetime) | Output only. The timestamp when the saved query was created. |
description | string | Optional. A human readable description of the saved query. |
displayName | string | Required. The user specified title for the SavedQuery. |
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) |
updateTime | string (google-datetime) | Output only. The timestamp when the saved query was last updated. |
visibility | string | Required. The visibility status of this query, which determines its ownership. |
Successful response
Name | Datatype | Description |
---|---|---|
name | string | Output only. Resource name of the saved query.In the format: "projects/[PROJECT_ID]/locations/[LOCATION_ID]/savedQueries/[QUERY_ID]" For a list of supported locations, see Supported Regions (https://cloud.google.com/logging/docs/region-support#bucket-regions)After the saved query is created, the location cannot be changed.If the user doesn't provide a QUERY_ID, the system will generate an alphanumeric ID. |
createTime | string (google-datetime) | Output only. The timestamp when the saved query was created. |
description | string | Optional. A human readable description of the saved query. |
displayName | string | Required. The user specified title for the SavedQuery. |
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) |
updateTime | string (google-datetime) | Output only. The timestamp when the saved query was last updated. |
visibility | string | Required. The visibility status of this query, which determines its ownership. |
Successful response
Name | Datatype | Description |
---|---|---|
name | string | Output only. Resource name of the saved query.In the format: "projects/[PROJECT_ID]/locations/[LOCATION_ID]/savedQueries/[QUERY_ID]" For a list of supported locations, see Supported Regions (https://cloud.google.com/logging/docs/region-support#bucket-regions)After the saved query is created, the location cannot be changed.If the user doesn't provide a QUERY_ID, the system will generate an alphanumeric ID. |
createTime | string (google-datetime) | Output only. The timestamp when the saved query was created. |
description | string | Optional. A human readable description of the saved query. |
displayName | string | Required. The user specified title for the SavedQuery. |
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) |
updateTime | string (google-datetime) | Output only. The timestamp when the saved query was last updated. |
visibility | string | Required. The visibility status of this query, which determines its ownership. |
Methods
The following methods are available for this resource:
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 | |
savedQueriesId | string | |
filter | string | |
pageSize | integer (int32) | |
pageToken | string | |
savedQueryId | string | |
updateMask | string (google-fieldmask) |
SELECT
examples
- projects_locations_saved_queries_get
- organizations_locations_saved_queries_get
- folders_locations_saved_queries_get
- billing_accounts_locations_saved_queries_get
- projects_locations_saved_queries_list
- organizations_locations_saved_queries_list
- folders_locations_saved_queries_list
- billing_accounts_locations_saved_queries_list
Returns all data associated with the requested query.
SELECT
name,
createTime,
description,
displayName,
loggingQuery,
opsAnalyticsQuery,
updateTime,
visibility
FROM google.logging.saved_queries
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND savedQueriesId = '{{ savedQueriesId }}' -- required;
Returns all data associated with the requested query.
SELECT
name,
createTime,
description,
displayName,
loggingQuery,
opsAnalyticsQuery,
updateTime,
visibility
FROM google.logging.saved_queries
WHERE organizationsId = '{{ organizationsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND savedQueriesId = '{{ savedQueriesId }}' -- required;
Returns all data associated with the requested query.
SELECT
name,
createTime,
description,
displayName,
loggingQuery,
opsAnalyticsQuery,
updateTime,
visibility
FROM google.logging.saved_queries
WHERE foldersId = '{{ foldersId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND savedQueriesId = '{{ savedQueriesId }}' -- required;
Returns all data associated with the requested query.
SELECT
name,
createTime,
description,
displayName,
loggingQuery,
opsAnalyticsQuery,
updateTime,
visibility
FROM google.logging.saved_queries
WHERE billingAccountsId = '{{ billingAccountsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND savedQueriesId = '{{ savedQueriesId }}' -- required;
Lists the SavedQueries that were created by the user making the request.
SELECT
name,
createTime,
description,
displayName,
loggingQuery,
opsAnalyticsQuery,
updateTime,
visibility
FROM google.logging.saved_queries
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND pageToken = '{{ pageToken }}'
AND pageSize = '{{ pageSize }}'
AND filter = '{{ filter }}';
Lists the SavedQueries that were created by the user making the request.
SELECT
name,
createTime,
description,
displayName,
loggingQuery,
opsAnalyticsQuery,
updateTime,
visibility
FROM google.logging.saved_queries
WHERE organizationsId = '{{ organizationsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND pageToken = '{{ pageToken }}'
AND pageSize = '{{ pageSize }}'
AND filter = '{{ filter }}';
Lists the SavedQueries that were created by the user making the request.
SELECT
name,
createTime,
description,
displayName,
loggingQuery,
opsAnalyticsQuery,
updateTime,
visibility
FROM google.logging.saved_queries
WHERE foldersId = '{{ foldersId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND pageToken = '{{ pageToken }}'
AND pageSize = '{{ pageSize }}'
AND filter = '{{ filter }}';
Lists the SavedQueries that were created by the user making the request.
SELECT
name,
createTime,
description,
displayName,
loggingQuery,
opsAnalyticsQuery,
updateTime,
visibility
FROM google.logging.saved_queries
WHERE billingAccountsId = '{{ billingAccountsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND pageToken = '{{ pageToken }}'
AND pageSize = '{{ pageSize }}'
AND filter = '{{ filter }}';
INSERT
examples
- projects_locations_saved_queries_create
- organizations_locations_saved_queries_create
- folders_locations_saved_queries_create
- billing_accounts_locations_saved_queries_create
- Manifest
Creates a new SavedQuery for the user making the request.
INSERT INTO google.logging.saved_queries (
data__displayName,
data__description,
data__loggingQuery,
data__opsAnalyticsQuery,
data__visibility,
projectsId,
locationsId,
savedQueryId
)
SELECT
'{{ displayName }}',
'{{ description }}',
'{{ loggingQuery }}',
'{{ opsAnalyticsQuery }}',
'{{ visibility }}',
'{{ projectsId }}',
'{{ locationsId }}',
'{{ savedQueryId }}'
RETURNING
name,
createTime,
description,
displayName,
loggingQuery,
opsAnalyticsQuery,
updateTime,
visibility
;
Creates a new SavedQuery for the user making the request.
INSERT INTO google.logging.saved_queries (
data__displayName,
data__description,
data__loggingQuery,
data__opsAnalyticsQuery,
data__visibility,
organizationsId,
locationsId,
savedQueryId
)
SELECT
'{{ displayName }}',
'{{ description }}',
'{{ loggingQuery }}',
'{{ opsAnalyticsQuery }}',
'{{ visibility }}',
'{{ organizationsId }}',
'{{ locationsId }}',
'{{ savedQueryId }}'
RETURNING
name,
createTime,
description,
displayName,
loggingQuery,
opsAnalyticsQuery,
updateTime,
visibility
;
Creates a new SavedQuery for the user making the request.
INSERT INTO google.logging.saved_queries (
data__displayName,
data__description,
data__loggingQuery,
data__opsAnalyticsQuery,
data__visibility,
foldersId,
locationsId,
savedQueryId
)
SELECT
'{{ displayName }}',
'{{ description }}',
'{{ loggingQuery }}',
'{{ opsAnalyticsQuery }}',
'{{ visibility }}',
'{{ foldersId }}',
'{{ locationsId }}',
'{{ savedQueryId }}'
RETURNING
name,
createTime,
description,
displayName,
loggingQuery,
opsAnalyticsQuery,
updateTime,
visibility
;
Creates a new SavedQuery for the user making the request.
INSERT INTO google.logging.saved_queries (
data__displayName,
data__description,
data__loggingQuery,
data__opsAnalyticsQuery,
data__visibility,
billingAccountsId,
locationsId,
savedQueryId
)
SELECT
'{{ displayName }}',
'{{ description }}',
'{{ loggingQuery }}',
'{{ opsAnalyticsQuery }}',
'{{ visibility }}',
'{{ billingAccountsId }}',
'{{ locationsId }}',
'{{ savedQueryId }}'
RETURNING
name,
createTime,
description,
displayName,
loggingQuery,
opsAnalyticsQuery,
updateTime,
visibility
;
# Description fields are for documentation purposes
- name: saved_queries
props:
- name: projectsId
value: string
description: Required parameter for the saved_queries resource.
- name: locationsId
value: string
description: Required parameter for the saved_queries resource.
- name: organizationsId
value: string
description: Required parameter for the saved_queries resource.
- name: foldersId
value: string
description: Required parameter for the saved_queries resource.
- name: billingAccountsId
value: string
description: Required parameter for the saved_queries resource.
- name: displayName
value: string
description: >
Required. The user specified title for the SavedQuery.
- name: description
value: string
description: >
Optional. A human readable description of the saved query.
- name: loggingQuery
value: object
description: >
Logging query that can be executed in Logs Explorer or via Logging API.
- name: opsAnalyticsQuery
value: object
description: >
Analytics query that can be executed in Log Analytics.
- name: visibility
value: string
description: >
Required. The visibility status of this query, which determines its ownership.
valid_values: ['VISIBILITY_UNSPECIFIED', 'PRIVATE', 'SHARED']
- name: savedQueryId
value: string
UPDATE
examples
- projects_locations_saved_queries_patch
- organizations_locations_saved_queries_patch
- folders_locations_saved_queries_patch
- billing_accounts_locations_saved_queries_patch
Updates an existing SavedQuery.
UPDATE google.logging.saved_queries
SET
data__displayName = '{{ displayName }}',
data__description = '{{ description }}',
data__loggingQuery = '{{ loggingQuery }}',
data__opsAnalyticsQuery = '{{ opsAnalyticsQuery }}',
data__visibility = '{{ visibility }}'
WHERE
projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND savedQueriesId = '{{ savedQueriesId }}' --required
AND updateMask = '{{ updateMask}}'
RETURNING
name,
createTime,
description,
displayName,
loggingQuery,
opsAnalyticsQuery,
updateTime,
visibility;
Updates an existing SavedQuery.
UPDATE google.logging.saved_queries
SET
data__displayName = '{{ displayName }}',
data__description = '{{ description }}',
data__loggingQuery = '{{ loggingQuery }}',
data__opsAnalyticsQuery = '{{ opsAnalyticsQuery }}',
data__visibility = '{{ visibility }}'
WHERE
organizationsId = '{{ organizationsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND savedQueriesId = '{{ savedQueriesId }}' --required
AND updateMask = '{{ updateMask}}'
RETURNING
name,
createTime,
description,
displayName,
loggingQuery,
opsAnalyticsQuery,
updateTime,
visibility;
Updates an existing SavedQuery.
UPDATE google.logging.saved_queries
SET
data__displayName = '{{ displayName }}',
data__description = '{{ description }}',
data__loggingQuery = '{{ loggingQuery }}',
data__opsAnalyticsQuery = '{{ opsAnalyticsQuery }}',
data__visibility = '{{ visibility }}'
WHERE
foldersId = '{{ foldersId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND savedQueriesId = '{{ savedQueriesId }}' --required
AND updateMask = '{{ updateMask}}'
RETURNING
name,
createTime,
description,
displayName,
loggingQuery,
opsAnalyticsQuery,
updateTime,
visibility;
Updates an existing SavedQuery.
UPDATE google.logging.saved_queries
SET
data__displayName = '{{ displayName }}',
data__description = '{{ description }}',
data__loggingQuery = '{{ loggingQuery }}',
data__opsAnalyticsQuery = '{{ opsAnalyticsQuery }}',
data__visibility = '{{ visibility }}'
WHERE
billingAccountsId = '{{ billingAccountsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND savedQueriesId = '{{ savedQueriesId }}' --required
AND updateMask = '{{ updateMask}}'
RETURNING
name,
createTime,
description,
displayName,
loggingQuery,
opsAnalyticsQuery,
updateTime,
visibility;
DELETE
examples
- projects_locations_saved_queries_delete
- organizations_locations_saved_queries_delete
- folders_locations_saved_queries_delete
- billing_accounts_locations_saved_queries_delete
Deletes an existing SavedQuery that was created by the user making the request.
DELETE FROM google.logging.saved_queries
WHERE projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND savedQueriesId = '{{ savedQueriesId }}' --required;
Deletes an existing SavedQuery that was created by the user making the request.
DELETE FROM google.logging.saved_queries
WHERE organizationsId = '{{ organizationsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND savedQueriesId = '{{ savedQueriesId }}' --required;
Deletes an existing SavedQuery that was created by the user making the request.
DELETE FROM google.logging.saved_queries
WHERE foldersId = '{{ foldersId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND savedQueriesId = '{{ savedQueriesId }}' --required;
Deletes an existing SavedQuery that was created by the user making the request.
DELETE FROM google.logging.saved_queries
WHERE billingAccountsId = '{{ billingAccountsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND savedQueriesId = '{{ savedQueriesId }}' --required;