Class: Google::Apis::LoggingV2::LogExclusion

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
lib/google/apis/logging_v2/classes.rb,
lib/google/apis/logging_v2/representations.rb,
lib/google/apis/logging_v2/representations.rb

Overview

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.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ LogExclusion

Returns a new instance of LogExclusion.



2241
2242
2243
# File 'lib/google/apis/logging_v2/classes.rb', line 2241

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#create_timeString

Output only. The creation timestamp of the exclusion.This field may not be present for older exclusions. Corresponds to the JSON property createTime

Returns:

  • (String)


2202
2203
2204
# File 'lib/google/apis/logging_v2/classes.rb', line 2202

def create_time
  @create_time
end

#descriptionString

Optional. A description of this exclusion. Corresponds to the JSON property description

Returns:

  • (String)


2207
2208
2209
# File 'lib/google/apis/logging_v2/classes.rb', line 2207

def description
  @description
end

#disabledBoolean Also known as: disabled?

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. Corresponds to the JSON property disabled

Returns:

  • (Boolean)


2214
2215
2216
# File 'lib/google/apis/logging_v2/classes.rb', line 2214

def disabled
  @disabled
end

#filterString

Required. 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) Corresponds to the JSON property filter

Returns:

  • (String)


2226
2227
2228
# File 'lib/google/apis/logging_v2/classes.rb', line 2226

def filter
  @filter
end

#nameString

Output only. 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. Corresponds to the JSON property name

Returns:

  • (String)


2233
2234
2235
# File 'lib/google/apis/logging_v2/classes.rb', line 2233

def name
  @name
end

#update_timeString

Output only. The last update timestamp of the exclusion.This field may not be present for older exclusions. Corresponds to the JSON property updateTime

Returns:

  • (String)


2239
2240
2241
# File 'lib/google/apis/logging_v2/classes.rb', line 2239

def update_time
  @update_time
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



2246
2247
2248
2249
2250
2251
2252
2253
# File 'lib/google/apis/logging_v2/classes.rb', line 2246

def update!(**args)
  @create_time = args[:create_time] if args.key?(:create_time)
  @description = args[:description] if args.key?(:description)
  @disabled = args[:disabled] if args.key?(:disabled)
  @filter = args[:filter] if args.key?(:filter)
  @name = args[:name] if args.key?(:name)
  @update_time = args[:update_time] if args.key?(:update_time)
end