Skip to main content

exclusions

Creates, updates, deletes, gets or lists an exclusions resource.

Overview​

Nameexclusions
TypeResource
Idgoogle.logging.exclusions

Fields​

The following fields are returned by SELECT queries:

NameDatatypeDescription
namestringOptional. A client-assigned identifier, such as "load-balancer-exclusion". Identifiers are limited to 100 characters and can include only letters, digits, underscores, hyphens, and periods. First character has to be alphanumeric.
createTimestring (google-datetime)Output only. The creation timestamp of the exclusion.This field may not be present for older exclusions.
descriptionstringOptional. A description of this exclusion.
disabledbooleanOptional. If set to True, then this exclusion is disabled and it does not exclude any log entries. You can update an exclusion to change the value of this field.
filterstringRequired. An advanced logs filter (https://docs.cloud.google.com/logging/docs/view/building-queries#queries-by-expression) that matches the log entries to be excluded. By using the sample function (https://docs.cloud.google.com/logging/docs/view/logging-query-language#sample), you can exclude less than 100% of the matching log entries.For example, the following query matches 99% of low-severity log entries from Google Cloud Storage buckets:resource.type=gcs_bucket severity<ERROR sample(insertId, 0.99)
updateTimestring (google-datetime)Output only. The last update timestamp of the exclusion.This field may not be present for older exclusions.

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
billing_accounts_exclusions_getselectbillingAccountsId, exclusionsIdGets the description of an exclusion in the _Default sink.
exclusions_listselectparentType, parentpageSize, pageTokenLists all the exclusions on the _Default sink in a parent resource.
folders_exclusions_getselectfoldersId, exclusionsIdGets the description of an exclusion in the _Default sink.
organizations_exclusions_getselectorganizationsId, exclusionsIdGets the description of an exclusion in the _Default sink.
projects_exclusions_getselectprojectsId, exclusionsIdGets the description of an exclusion in the _Default sink.
billing_accounts_exclusions_listselectbillingAccountsIdpageSize, pageTokenLists all the exclusions on the _Default sink in a parent resource.
exclusions_getselectnameGets the description of an exclusion in the _Default sink.
folders_exclusions_listselectfoldersIdpageSize, pageTokenLists all the exclusions on the _Default sink in a parent resource.
organizations_exclusions_listselectorganizationsIdpageSize, pageTokenLists all the exclusions on the _Default sink in a parent resource.
projects_exclusions_listselectprojectsIdpageSize, pageTokenLists all the exclusions on the _Default sink in a parent resource.
exclusions_createinsertparentType, parentCreates a new exclusion in the _Default sink in a specified parent resource. Only log entries belonging to that resource can be excluded. You can have up to 10 exclusions in a resource.
billing_accounts_exclusions_createinsertbillingAccountsIdCreates a new exclusion in the _Default sink in a specified parent resource. Only log entries belonging to that resource can be excluded. You can have up to 10 exclusions in a resource.
folders_exclusions_createinsertfoldersIdCreates a new exclusion in the _Default sink in a specified parent resource. Only log entries belonging to that resource can be excluded. You can have up to 10 exclusions in a resource.
organizations_exclusions_createinsertorganizationsIdCreates a new exclusion in the _Default sink in a specified parent resource. Only log entries belonging to that resource can be excluded. You can have up to 10 exclusions in a resource.
projects_exclusions_createinsertprojectsIdCreates a new exclusion in the _Default sink in a specified parent resource. Only log entries belonging to that resource can be excluded. You can have up to 10 exclusions in a resource.
billing_accounts_exclusions_patchupdatebillingAccountsId, exclusionsIdupdateMaskChanges one or more properties of an existing exclusion in the _Default sink.
folders_exclusions_patchupdatefoldersId, exclusionsIdupdateMaskChanges one or more properties of an existing exclusion in the _Default sink.
organizations_exclusions_patchupdateorganizationsId, exclusionsIdupdateMaskChanges one or more properties of an existing exclusion in the _Default sink.
projects_exclusions_patchupdateprojectsId, exclusionsIdupdateMaskChanges one or more properties of an existing exclusion in the _Default sink.
exclusions_patchupdatenameupdateMaskChanges one or more properties of an existing exclusion in the _Default sink.
billing_accounts_exclusions_deletedeletebillingAccountsId, exclusionsIdDeletes an exclusion in the _Default sink.
folders_exclusions_deletedeletefoldersId, exclusionsIdDeletes an exclusion in the _Default sink.
organizations_exclusions_deletedeleteorganizationsId, exclusionsIdDeletes an exclusion in the _Default sink.
projects_exclusions_deletedeleteprojectsId, exclusionsIdDeletes an exclusion in the _Default sink.
exclusions_deletedeletenameDeletes an exclusion in the _Default sink.

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.

NameDatatypeDescription
billingAccountsIdstring
exclusionsIdstring
foldersIdstring
namestring
organizationsIdstring
parentstring
parentTypestring
projectsIdstring
pageSizeinteger (int32)
pageTokenstring
updateMaskstring (google-fieldmask)

SELECT examples​

Gets the description of an exclusion in the _Default sink.

SELECT
name,
createTime,
description,
disabled,
filter,
updateTime
FROM google.logging.exclusions
WHERE billingAccountsId = '{{ billingAccountsId }}' -- required
AND exclusionsId = '{{ exclusionsId }}' -- required
;

INSERT examples​

Creates a new exclusion in the _Default sink in a specified parent resource. Only log entries belonging to that resource can be excluded. You can have up to 10 exclusions in a resource.

INSERT INTO google.logging.exclusions (
data__description,
data__disabled,
data__filter,
data__name,
parentType,
parent
)
SELECT
'{{ description }}',
{{ disabled }},
'{{ filter }}',
'{{ name }}',
'{{ parentType }}',
'{{ parent }}'
RETURNING
name,
createTime,
description,
disabled,
filter,
updateTime
;

UPDATE examples​

Changes one or more properties of an existing exclusion in the _Default sink.

UPDATE google.logging.exclusions
SET
data__description = '{{ description }}',
data__disabled = {{ disabled }},
data__filter = '{{ filter }}',
data__name = '{{ name }}'
WHERE
billingAccountsId = '{{ billingAccountsId }}' --required
AND exclusionsId = '{{ exclusionsId }}' --required
AND updateMask = '{{ updateMask}}'
RETURNING
name,
createTime,
description,
disabled,
filter,
updateTime;

DELETE examples​

Deletes an exclusion in the _Default sink.

DELETE FROM google.logging.exclusions
WHERE billingAccountsId = '{{ billingAccountsId }}' --required
AND exclusionsId = '{{ exclusionsId }}' --required
;