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