Skip to main content

views

Creates, updates, deletes, gets or lists a views resource.

Overview

Nameviews
TypeResource
Idgoogle.logging.views

Fields

NameDatatypeDescription
namestringOutput only. The resource name of the view.For example:projects/my-project/locations/global/buckets/my-bucket/views/my-view
descriptionstringOptional. Describes this view.
createTimestringOutput only. The creation timestamp of the view.
filterstringOptional. Filter that restricts which log entries in a bucket are visible in this view.Filters must be logical conjunctions that use the AND operator, and they can use any of the following qualifiers: SOURCE(), which specifies a project, folder, organization, or billing account of origin. resource.type, which specifies the resource type. LOG_ID(), which identifies the log.They can also use the negations of these qualifiers with the NOT operator.For example:SOURCE("projects/myproject") AND resource.type = "gce_instance" AND NOT LOG_ID("stdout")
updateTimestringOutput only. The last update timestamp of the view.

Methods

NameAccessible byRequired ParamsDescription
billing_accounts_locations_buckets_views_getSELECTbillingAccountsId, bucketsId, locationsId, viewsIdGets a view on a log bucket.
billing_accounts_locations_buckets_views_listSELECTbillingAccountsId, bucketsId, locationsIdLists views on a log bucket.
folders_locations_buckets_views_getSELECTbucketsId, foldersId, locationsId, viewsIdGets a view on a log bucket.
folders_locations_buckets_views_listSELECTbucketsId, foldersId, locationsIdLists views on a log bucket.
locations_buckets_views_listSELECTparent, parentTypeLists views on a log bucket.
organizations_locations_buckets_views_getSELECTbucketsId, locationsId, organizationsId, viewsIdGets a view on a log bucket.
organizations_locations_buckets_views_listSELECTbucketsId, locationsId, organizationsIdLists views on a log bucket.
projects_locations_buckets_views_getSELECTbucketsId, locationsId, projectsId, viewsIdGets a view on a log bucket.
projects_locations_buckets_views_listSELECTbucketsId, locationsId, projectsIdLists views on a log bucket.
billing_accounts_locations_buckets_views_createINSERTbillingAccountsId, bucketsId, locationsIdCreates a view over log entries in a log bucket. A bucket may contain a maximum of 30 views.
folders_locations_buckets_views_createINSERTbucketsId, foldersId, locationsIdCreates a view over log entries in a log bucket. A bucket may contain a maximum of 30 views.
locations_buckets_views_createINSERTparent, parentTypeCreates a view over log entries in a log bucket. A bucket may contain a maximum of 30 views.
organizations_locations_buckets_views_createINSERTbucketsId, locationsId, organizationsIdCreates a view over log entries in a log bucket. A bucket may contain a maximum of 30 views.
projects_locations_buckets_views_createINSERTbucketsId, locationsId, projectsIdCreates a view over log entries in a log bucket. A bucket may contain a maximum of 30 views.
billing_accounts_locations_buckets_views_deleteDELETEbillingAccountsId, bucketsId, locationsId, viewsIdDeletes a view on a log bucket. If an UNAVAILABLE error is returned, this indicates that system is not in a state where it can delete the view. If this occurs, please try again in a few minutes.
folders_locations_buckets_views_deleteDELETEbucketsId, foldersId, locationsId, viewsIdDeletes a view on a log bucket. If an UNAVAILABLE error is returned, this indicates that system is not in a state where it can delete the view. If this occurs, please try again in a few minutes.
organizations_locations_buckets_views_deleteDELETEbucketsId, locationsId, organizationsId, viewsIdDeletes a view on a log bucket. If an UNAVAILABLE error is returned, this indicates that system is not in a state where it can delete the view. If this occurs, please try again in a few minutes.
projects_locations_buckets_views_deleteDELETEbucketsId, locationsId, projectsId, viewsIdDeletes a view on a log bucket. If an UNAVAILABLE error is returned, this indicates that system is not in a state where it can delete the view. If this occurs, please try again in a few minutes.
billing_accounts_locations_buckets_views_patchUPDATEbillingAccountsId, bucketsId, locationsId, viewsIdUpdates a view on a log bucket. This method replaces the value of the filter field from the existing view with the corresponding value from the new view. If an UNAVAILABLE error is returned, this indicates that system is not in a state where it can update the view. If this occurs, please try again in a few minutes.
folders_locations_buckets_views_patchUPDATEbucketsId, foldersId, locationsId, viewsIdUpdates a view on a log bucket. This method replaces the value of the filter field from the existing view with the corresponding value from the new view. If an UNAVAILABLE error is returned, this indicates that system is not in a state where it can update the view. If this occurs, please try again in a few minutes.
organizations_locations_buckets_views_patchUPDATEbucketsId, locationsId, organizationsId, viewsIdUpdates a view on a log bucket. This method replaces the value of the filter field from the existing view with the corresponding value from the new view. If an UNAVAILABLE error is returned, this indicates that system is not in a state where it can update the view. If this occurs, please try again in a few minutes.
projects_locations_buckets_views_patchUPDATEbucketsId, locationsId, projectsId, viewsIdUpdates a view on a log bucket. This method replaces the value of the filter field from the existing view with the corresponding value from the new view. If an UNAVAILABLE error is returned, this indicates that system is not in a state where it can update the view. If this occurs, please try again in a few minutes.

SELECT examples

Lists views on a log bucket.

SELECT
name,
description,
createTime,
filter,
updateTime
FROM google.logging.views
WHERE parent = '{{ parent }}'
AND parentType = '{{ parentType }}';

INSERT example

Use the following StackQL query and manifest file to create a new views resource.

/*+ create */
INSERT INTO google.logging.views (
parent,
parentType,
description,
filter
)
SELECT
'{{ parent }}',
'{{ parentType }}',
'{{ description }}',
'{{ filter }}'
;

UPDATE example

Updates a views resource.

/*+ update */
UPDATE google.logging.views
SET
description = '{{ description }}',
filter = '{{ filter }}'
WHERE
bucketsId = '{{ bucketsId }}'
AND foldersId = '{{ foldersId }}'
AND locationsId = '{{ locationsId }}'
AND viewsId = '{{ viewsId }}';

DELETE example

Deletes the specified views resource.

/*+ delete */
DELETE FROM google.logging.views
WHERE bucketsId = '{{ bucketsId }}'
AND foldersId = '{{ foldersId }}'
AND locationsId = '{{ locationsId }}'
AND viewsId = '{{ viewsId }}';