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:
- billing_accounts_locations_saved_queries_get
- folders_locations_saved_queries_get
- projects_locations_saved_queries_get
- organizations_locations_saved_queries_get
- billing_accounts_locations_saved_queries_list
- folders_locations_saved_queries_list
- projects_locations_saved_queries_list
- organizations_locations_saved_queries_list
| 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://docs.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. (VISIBILITY_UNSPECIFIED, PRIVATE, SHARED) |
| 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://docs.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. (VISIBILITY_UNSPECIFIED, PRIVATE, SHARED) |
| 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://docs.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. (VISIBILITY_UNSPECIFIED, PRIVATE, SHARED) |
| 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://docs.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. (VISIBILITY_UNSPECIFIED, PRIVATE, SHARED) |
| 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://docs.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. (VISIBILITY_UNSPECIFIED, PRIVATE, SHARED) |
| 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://docs.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. (VISIBILITY_UNSPECIFIED, PRIVATE, SHARED) |
| 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://docs.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. (VISIBILITY_UNSPECIFIED, PRIVATE, SHARED) |
| 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://docs.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. (VISIBILITY_UNSPECIFIED, PRIVATE, SHARED) |
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
- billing_accounts_locations_saved_queries_get
- folders_locations_saved_queries_get
- projects_locations_saved_queries_get
- organizations_locations_saved_queries_get
- billing_accounts_locations_saved_queries_list
- folders_locations_saved_queries_list
- projects_locations_saved_queries_list
- organizations_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 billingAccountsId = '{{ billingAccountsId }}' -- 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 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
;
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 filter = '{{ filter }}'
AND pageToken = '{{ pageToken }}'
AND pageSize = '{{ pageSize }}'
;
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 filter = '{{ filter }}'
AND pageToken = '{{ pageToken }}'
AND pageSize = '{{ pageSize }}'
;
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 }}'
;
INSERT examples
- billing_accounts_locations_saved_queries_create
- folders_locations_saved_queries_create
- projects_locations_saved_queries_create
- organizations_locations_saved_queries_create
- Manifest
Creates a new SavedQuery for the user making the request.
INSERT INTO google.logging.saved_queries (
data__visibility,
data__description,
data__opsAnalyticsQuery,
data__displayName,
data__loggingQuery,
billingAccountsId,
locationsId,
savedQueryId
)
SELECT
'{{ visibility }}',
'{{ description }}',
'{{ opsAnalyticsQuery }}',
'{{ displayName }}',
'{{ loggingQuery }}',
'{{ billingAccountsId }}',
'{{ 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__visibility,
data__description,
data__opsAnalyticsQuery,
data__displayName,
data__loggingQuery,
foldersId,
locationsId,
savedQueryId
)
SELECT
'{{ visibility }}',
'{{ description }}',
'{{ opsAnalyticsQuery }}',
'{{ displayName }}',
'{{ loggingQuery }}',
'{{ 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__visibility,
data__description,
data__opsAnalyticsQuery,
data__displayName,
data__loggingQuery,
projectsId,
locationsId,
savedQueryId
)
SELECT
'{{ visibility }}',
'{{ description }}',
'{{ opsAnalyticsQuery }}',
'{{ displayName }}',
'{{ loggingQuery }}',
'{{ 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__visibility,
data__description,
data__opsAnalyticsQuery,
data__displayName,
data__loggingQuery,
organizationsId,
locationsId,
savedQueryId
)
SELECT
'{{ visibility }}',
'{{ description }}',
'{{ opsAnalyticsQuery }}',
'{{ displayName }}',
'{{ loggingQuery }}',
'{{ organizationsId }}',
'{{ locationsId }}',
'{{ savedQueryId }}'
RETURNING
name,
createTime,
description,
displayName,
loggingQuery,
opsAnalyticsQuery,
updateTime,
visibility
;
# Description fields are for documentation purposes
- name: saved_queries
props:
- name: billingAccountsId
value: "{{ billingAccountsId }}"
description: Required parameter for the saved_queries resource.
- name: locationsId
value: "{{ locationsId }}"
description: Required parameter for the saved_queries resource.
- name: foldersId
value: "{{ foldersId }}"
description: Required parameter for the saved_queries resource.
- name: projectsId
value: "{{ projectsId }}"
description: Required parameter for the saved_queries resource.
- name: organizationsId
value: "{{ organizationsId }}"
description: Required parameter for the saved_queries resource.
- name: visibility
value: "{{ visibility }}"
description: |
Required. The visibility status of this query, which determines its ownership.
valid_values: ['VISIBILITY_UNSPECIFIED', 'PRIVATE', 'SHARED']
- name: description
value: "{{ description }}"
description: |
Optional. A human readable description of the saved query.
- name: opsAnalyticsQuery
description: |
Analytics query that can be executed in Log Analytics.
value:
sqlQueryText: "{{ sqlQueryText }}"
queryBuilder:
filter:
operatorType: "{{ operatorType }}"
leafPredicate:
literalValue: "{{ literalValue }}"
comparator: "{{ comparator }}"
fieldSource:
parentPath: "{{ parentPath }}"
projectedField: "{{ projectedField }}"
field: "{{ field }}"
aliasRef: "{{ aliasRef }}"
isJson: {{ isJson }}
columnType: "{{ columnType }}"
isNegation: {{ isNegation }}
fieldSourceValue:
parentPath: "{{ parentPath }}"
projectedField: "{{ projectedField }}"
field: "{{ field }}"
aliasRef: "{{ aliasRef }}"
isJson: {{ isJson }}
columnType: "{{ columnType }}"
childPredicates:
- operatorType: "{{ operatorType }}"
leafPredicate:
literalValue: "{{ literalValue }}"
comparator: "{{ comparator }}"
fieldSource: "{{ fieldSource }}"
isNegation: {{ isNegation }}
fieldSourceValue: "{{ fieldSourceValue }}"
childPredicates: "{{ childPredicates }}"
limit: "{{ limit }}"
searchTerm: "{{ searchTerm }}"
resourceNames:
- "{{ resourceNames }}"
orderBys:
- fieldSource:
parentPath: "{{ parentPath }}"
projectedField:
cast: "{{ cast }}"
field: "{{ field }}"
operation: "{{ operation }}"
alias: "{{ alias }}"
truncationGranularity: "{{ truncationGranularity }}"
virtualField: "{{ virtualField }}"
sqlAggregationFunction: "{{ sqlAggregationFunction }}"
regexExtraction: "{{ regexExtraction }}"
field: "{{ field }}"
aliasRef: "{{ aliasRef }}"
isJson: {{ isJson }}
columnType: "{{ columnType }}"
sortOrderDirection: "{{ sortOrderDirection }}"
fieldSources:
- parentPath: "{{ parentPath }}"
projectedField:
cast: "{{ cast }}"
field: "{{ field }}"
operation: "{{ operation }}"
alias: "{{ alias }}"
truncationGranularity: "{{ truncationGranularity }}"
virtualField:
virtualFieldType: "{{ virtualFieldType }}"
underlyingFieldSources: "{{ underlyingFieldSources }}"
sqlAggregationFunction:
type: "{{ type }}"
parameters: "{{ parameters }}"
regexExtraction: "{{ regexExtraction }}"
field: "{{ field }}"
aliasRef: "{{ aliasRef }}"
isJson: {{ isJson }}
columnType: "{{ columnType }}"
- name: displayName
value: "{{ displayName }}"
description: |
Required. The user specified title for the SavedQuery.
- name: loggingQuery
description: |
Logging query that can be executed in Logs Explorer or via Logging API.
value:
summaryFieldEnd: {{ summaryFieldEnd }}
summaryFieldStart: {{ summaryFieldStart }}
filter: "{{ filter }}"
summaryFields:
- field: "{{ field }}"
- name: savedQueryId
value: "{{ savedQueryId }}"
UPDATE examples
- billing_accounts_locations_saved_queries_patch
- folders_locations_saved_queries_patch
- projects_locations_saved_queries_patch
- organizations_locations_saved_queries_patch
Updates an existing SavedQuery.
UPDATE google.logging.saved_queries
SET
data__visibility = '{{ visibility }}',
data__description = '{{ description }}',
data__opsAnalyticsQuery = '{{ opsAnalyticsQuery }}',
data__displayName = '{{ displayName }}',
data__loggingQuery = '{{ loggingQuery }}'
WHERE
billingAccountsId = '{{ billingAccountsId }}' --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__visibility = '{{ visibility }}',
data__description = '{{ description }}',
data__opsAnalyticsQuery = '{{ opsAnalyticsQuery }}',
data__displayName = '{{ displayName }}',
data__loggingQuery = '{{ loggingQuery }}'
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__visibility = '{{ visibility }}',
data__description = '{{ description }}',
data__opsAnalyticsQuery = '{{ opsAnalyticsQuery }}',
data__displayName = '{{ displayName }}',
data__loggingQuery = '{{ loggingQuery }}'
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__visibility = '{{ visibility }}',
data__description = '{{ description }}',
data__opsAnalyticsQuery = '{{ opsAnalyticsQuery }}',
data__displayName = '{{ displayName }}',
data__loggingQuery = '{{ loggingQuery }}'
WHERE
organizationsId = '{{ organizationsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND savedQueriesId = '{{ savedQueriesId }}' --required
AND updateMask = '{{ updateMask}}'
RETURNING
name,
createTime,
description,
displayName,
loggingQuery,
opsAnalyticsQuery,
updateTime,
visibility;
DELETE examples
- billing_accounts_locations_saved_queries_delete
- folders_locations_saved_queries_delete
- projects_locations_saved_queries_delete
- organizations_locations_saved_queries_delete
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
;
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 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
;