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:

Successful response

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://cloud.google.com/logging/docs/view/advanced-queries) that matches the log entries to be excluded. By using the sample function (https://cloud.google.com/logging/docs/view/advanced-queries#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
exclusions_listselectparentType, parentpageToken, pageSizeLists all the exclusions on the _Default sink in a parent resource.
projects_exclusions_getselectprojectsId, exclusionsIdGets the description of an exclusion in the _Default sink.
organizations_exclusions_getselectorganizationsId, exclusionsIdGets the description of an exclusion in the _Default sink.
folders_exclusions_getselectfoldersId, exclusionsIdGets the description of an exclusion in the _Default sink.
billing_accounts_exclusions_getselectbillingAccountsId, exclusionsIdGets the description of an exclusion in the _Default sink.
exclusions_getselectnameGets the description of an exclusion in the _Default sink.
projects_exclusions_listselectprojectsIdpageToken, pageSizeLists all the exclusions on the _Default sink in a parent resource.
organizations_exclusions_listselectorganizationsIdpageToken, pageSizeLists all the exclusions on the _Default sink in a parent resource.
folders_exclusions_listselectfoldersIdpageToken, pageSizeLists all the exclusions on the _Default sink in a parent resource.
billing_accounts_exclusions_listselectbillingAccountsIdpageToken, pageSizeLists 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.
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.
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.
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.
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.
projects_exclusions_patchupdateprojectsId, 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.
folders_exclusions_patchupdatefoldersId, exclusionsIdupdateMaskChanges one or more properties of an existing exclusion in the _Default sink.
billing_accounts_exclusions_patchupdatebillingAccountsId, 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.
projects_exclusions_deletedeleteprojectsId, exclusionsIdDeletes an exclusion in the _Default sink.
organizations_exclusions_deletedeleteorganizationsId, exclusionsIdDeletes an exclusion in the _Default sink.
folders_exclusions_deletedeletefoldersId, exclusionsIdDeletes an exclusion in the _Default sink.
billing_accounts_exclusions_deletedeletebillingAccountsId, 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

Lists all the exclusions on the _Default sink in a parent resource.

SELECT
name,
createTime,
description,
disabled,
filter,
updateTime
FROM google.logging.exclusions
WHERE parentType = '{{ parentType }}' -- required
AND parent = '{{ parent }}' -- required
AND pageToken = '{{ pageToken }}'
AND pageSize = '{{ pageSize }}';

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__name,
data__description,
data__filter,
data__disabled,
parentType,
parent
)
SELECT
'{{ name }}',
'{{ description }}',
'{{ filter }}',
{{ disabled }},
'{{ 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__name = '{{ name }}',
data__description = '{{ description }}',
data__filter = '{{ filter }}',
data__disabled = {{ disabled }}
WHERE
projectsId = '{{ projectsId }}' --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 projectsId = '{{ projectsId }}' --required
AND exclusionsId = '{{ exclusionsId }}' --required;