Reference documentation and code samples for the Cloud Logging V2 API class Google::Cloud::Logging::V2::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.
This field may not be present for older exclusions.
#description
defdescription()->::String
Returns
(::String) — Optional. A description of this exclusion.
#description=
defdescription=(value)->::String
Parameter
value (::String) — Optional. A description of this exclusion.
Returns
(::String) — Optional. A description of this exclusion.
#disabled
defdisabled()->::Boolean
Returns
(::Boolean) — Optional. If set to True, then this exclusion is disabled and it does not
exclude any log entries. You can [update an
exclusion][google.logging.v2.ConfigServiceV2.UpdateExclusion] to change the
value of this field.
#disabled=
defdisabled=(value)->::Boolean
Parameter
value (::Boolean) — Optional. If set to True, then this exclusion is disabled and it does not
exclude any log entries. You can [update an
exclusion][google.logging.v2.ConfigServiceV2.UpdateExclusion] to change the
value of this field.
Returns
(::Boolean) — Optional. If set to True, then this exclusion is disabled and it does not
exclude any log entries. You can [update an
exclusion][google.logging.v2.ConfigServiceV2.UpdateExclusion] to change the
value of this field.
#filter
deffilter()->::String
Returns
(::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:
value (::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:
(::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:
(::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.
#name=
defname=(value)->::String
Parameter
value (::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.
Returns
(::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.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-28 UTC."],[],[],null,["# Cloud Logging V2 API - Class Google::Cloud::Logging::V2::LogExclusion (v1.3.0)\n\nVersion latestkeyboard_arrow_down\n\n- [1.3.0 (latest)](/ruby/docs/reference/google-cloud-logging-v2/latest/Google-Cloud-Logging-V2-LogExclusion)\n- [1.2.1](/ruby/docs/reference/google-cloud-logging-v2/1.2.1/Google-Cloud-Logging-V2-LogExclusion)\n- [1.1.0](/ruby/docs/reference/google-cloud-logging-v2/1.1.0/Google-Cloud-Logging-V2-LogExclusion)\n- [1.0.1](/ruby/docs/reference/google-cloud-logging-v2/1.0.1/Google-Cloud-Logging-V2-LogExclusion)\n- [0.13.0](/ruby/docs/reference/google-cloud-logging-v2/0.13.0/Google-Cloud-Logging-V2-LogExclusion)\n- [0.12.2](/ruby/docs/reference/google-cloud-logging-v2/0.12.2/Google-Cloud-Logging-V2-LogExclusion)\n- [0.11.0](/ruby/docs/reference/google-cloud-logging-v2/0.11.0/Google-Cloud-Logging-V2-LogExclusion)\n- [0.10.1](/ruby/docs/reference/google-cloud-logging-v2/0.10.1/Google-Cloud-Logging-V2-LogExclusion)\n- [0.9.0](/ruby/docs/reference/google-cloud-logging-v2/0.9.0/Google-Cloud-Logging-V2-LogExclusion)\n- [0.8.1](/ruby/docs/reference/google-cloud-logging-v2/0.8.1/Google-Cloud-Logging-V2-LogExclusion)\n- [0.7.0](/ruby/docs/reference/google-cloud-logging-v2/0.7.0/Google-Cloud-Logging-V2-LogExclusion)\n- [0.6.0](/ruby/docs/reference/google-cloud-logging-v2/0.6.0/Google-Cloud-Logging-V2-LogExclusion)\n- [0.5.6](/ruby/docs/reference/google-cloud-logging-v2/0.5.6/Google-Cloud-Logging-V2-LogExclusion) \nReference documentation and code samples for the Cloud Logging V2 API class Google::Cloud::Logging::V2::LogExclusion.\n\nSpecifies a set of log entries that are filtered out by a sink. If\nyour Google Cloud resource receives a large volume of log entries, you can\nuse exclusions to reduce your chargeable logs. Note that exclusions on\norganization-level and folder-level sinks don't apply to child resources.\nNote also that you cannot modify the _Required sink or exclude logs from it. \n\nInherits\n--------\n\n- Object \n\nExtended By\n-----------\n\n- Google::Protobuf::MessageExts::ClassMethods \n\nIncludes\n--------\n\n- Google::Protobuf::MessageExts\n\nMethods\n-------\n\n### #create_time\n\n def create_time() -\u003e ::Google::Protobuf::Timestamp\n\n**Returns**\n\n- ([::Google::Protobuf::Timestamp](./Google-Protobuf-Timestamp)) --- Output only. The creation timestamp of the exclusion.\n\n\n This field may not be present for older exclusions.\n\n### #description\n\n def description() -\u003e ::String\n\n**Returns**\n\n- (::String) --- Optional. A description of this exclusion.\n\n### #description=\n\n def description=(value) -\u003e ::String\n\n**Parameter**\n\n- **value** (::String) --- Optional. A description of this exclusion. \n**Returns**\n\n- (::String) --- Optional. A description of this exclusion.\n\n### #disabled\n\n def disabled() -\u003e ::Boolean\n\n**Returns**\n\n- (::Boolean) --- Optional. If set to True, then this exclusion is disabled and it does not exclude any log entries. You can \\[update an exclusion\\]\\[google.logging.v2.ConfigServiceV2.UpdateExclusion\\] to change the value of this field.\n\n### #disabled=\n\n def disabled=(value) -\u003e ::Boolean\n\n**Parameter**\n\n- **value** (::Boolean) --- Optional. If set to True, then this exclusion is disabled and it does not exclude any log entries. You can \\[update an exclusion\\]\\[google.logging.v2.ConfigServiceV2.UpdateExclusion\\] to change the value of this field. \n**Returns**\n\n- (::Boolean) --- Optional. If set to True, then this exclusion is disabled and it does not exclude any log entries. You can \\[update an exclusion\\]\\[google.logging.v2.ConfigServiceV2.UpdateExclusion\\] to change the value of this field.\n\n### #filter\n\n def filter() -\u003e ::String\n\n**Returns**\n\n- (::String) --- Required. An [advanced logs\n filter](https://cloud.google.com/logging/docs/view/advanced-queries) that matches the log entries to be excluded. By using the [sample\n function](https://cloud.google.com/logging/docs/view/advanced-queries#sample), you can exclude less than 100% of the matching log entries.\n\n\n For example, the following query matches 99% of low-severity log entries\n from Google Cloud Storage buckets:\n\n `resource.type=gcs_bucket severity\u003cERROR sample(insertId, 0.99)`\n\n### #filter=\n\n def filter=(value) -\u003e ::String\n\n**Parameter**\n\n- **value** (::String) --- Required. An [advanced logs\n filter](https://cloud.google.com/logging/docs/view/advanced-queries) that matches the log entries to be excluded. By using the [sample\n function](https://cloud.google.com/logging/docs/view/advanced-queries#sample), you can exclude less than 100% of the matching log entries.\n\n\n For example, the following query matches 99% of low-severity log entries\n from Google Cloud Storage buckets:\n\n`resource.type=gcs_bucket severity\u003cERROR sample(insertId, 0.99)` \n**Returns**\n\n- (::String) --- Required. An [advanced logs\n filter](https://cloud.google.com/logging/docs/view/advanced-queries) that matches the log entries to be excluded. By using the [sample\n function](https://cloud.google.com/logging/docs/view/advanced-queries#sample), you can exclude less than 100% of the matching log entries.\n\n\n For example, the following query matches 99% of low-severity log entries\n from Google Cloud Storage buckets:\n\n `resource.type=gcs_bucket severity\u003cERROR sample(insertId, 0.99)`\n\n### #name\n\n def name() -\u003e ::String\n\n**Returns**\n\n- (::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.\n\n### #name=\n\n def name=(value) -\u003e ::String\n\n**Parameter**\n\n- **value** (::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. \n**Returns**\n\n- (::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.\n\n### #update_time\n\n def update_time() -\u003e ::Google::Protobuf::Timestamp\n\n**Returns**\n\n- ([::Google::Protobuf::Timestamp](./Google-Protobuf-Timestamp)) --- Output only. The last update timestamp of the exclusion.\n\n\n This field may not be present for older exclusions."]]