Stackdriver Logging V2 Client - Class LogExclusion (1.30.0)

Reference documentation and code samples for the Stackdriver Logging V2 Client class LogExclusion.

Specifies a set of log entries that are filtered out by a sink. If your Google Cloud resource receives a large volume of log entries, you can use exclusions to reduce your chargeable logs. Note that exclusions on organization-level and folder-level sinks don't apply to child resources.

Note also that you cannot modify the _Required sink or exclude logs from it.

Generated from protobuf message google.logging.v2.LogExclusion

Namespace

Google \ Cloud \ Logging \ V2

Methods

__construct

Constructor.

Parameters
Name Description
data array

Optional. Data for populating the Message object.

↳ name string

Required. 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.

↳ description string

Optional. A description of this exclusion.

↳ filter string

Required. An advanced logs filter that matches the log entries to be excluded. By using the sample function, 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)

↳ disabled bool

Optional. 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.

↳ create_time Google\Protobuf\Timestamp

Output only. The creation timestamp of the exclusion. This field may not be present for older exclusions.

↳ update_time Google\Protobuf\Timestamp

Output only. The last update timestamp of the exclusion. This field may not be present for older exclusions.

getName

Required. 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.

Returns
Type Description
string

setName

Required. 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.

Parameter
Name Description
var string
Returns
Type Description
$this

getDescription

Optional. A description of this exclusion.

Returns
Type Description
string

setDescription

Optional. A description of this exclusion.

Parameter
Name Description
var string
Returns
Type Description
$this

getFilter

Required. An advanced logs filter that matches the log entries to be excluded. By using the sample function, 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)

Returns
Type Description
string

setFilter

Required. An advanced logs filter that matches the log entries to be excluded. By using the sample function, 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)

Parameter
Name Description
var string
Returns
Type Description
$this

getDisabled

Optional. 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.

Returns
Type Description
bool

setDisabled

Optional. 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.

Parameter
Name Description
var bool
Returns
Type Description
$this

getCreateTime

Output only. The creation timestamp of the exclusion.

This field may not be present for older exclusions.

Returns
Type Description
Google\Protobuf\Timestamp|null

hasCreateTime

clearCreateTime

setCreateTime

Output only. The creation timestamp of the exclusion.

This field may not be present for older exclusions.

Parameter
Name Description
var Google\Protobuf\Timestamp
Returns
Type Description
$this

getUpdateTime

Output only. The last update timestamp of the exclusion.

This field may not be present for older exclusions.

Returns
Type Description
Google\Protobuf\Timestamp|null

hasUpdateTime

clearUpdateTime

setUpdateTime

Output only. The last update timestamp of the exclusion.

This field may not be present for older exclusions.

Parameter
Name Description
var Google\Protobuf\Timestamp
Returns
Type Description
$this