Class: DatadogAPIClient::V1::LogsExclusionFilter

Inherits:
Object
  • Object
show all
Defined in:
lib/datadog_api_client/v1/models/logs_exclusion_filter.rb

Overview

Exclusion filter is defined by a query, a sampling rule, and a active/inactive toggle.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ LogsExclusionFilter

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    attributes Model attributes in the form of hash



65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# File 'lib/datadog_api_client/v1/models/logs_exclusion_filter.rb', line 65

def initialize(attributes = {})
  if (!attributes.is_a?(Hash))
    fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V1::LogsExclusionFilter` initialize method"
  end

  # check to see if the attribute exists and convert string to symbol for hash key
  attributes = attributes.each_with_object({}) { |(k, v), h|
    if (!self.class.attribute_map.key?(k.to_sym))
      fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V1::LogsExclusionFilter`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
    end
    h[k.to_sym] = v
  }

  if attributes.key?(:'query')
    self.query = attributes[:'query']
  end

  if attributes.key?(:'sample_rate')
    self.sample_rate = attributes[:'sample_rate']
  end
end

Instance Attribute Details

#queryObject

Default query is ‘*`, meaning all logs flowing in the index would be excluded. Scope down exclusion filter to only a subset of logs with a log query.



27
28
29
# File 'lib/datadog_api_client/v1/models/logs_exclusion_filter.rb', line 27

def query
  @query
end

#sample_rateObject

Sample rate to apply to logs going through this exclusion filter, a value of 1.0 excludes all logs matching the query.



30
31
32
# File 'lib/datadog_api_client/v1/models/logs_exclusion_filter.rb', line 30

def sample_rate
  @sample_rate
end