Class: Google::Apis::MonitoringV3::LogMatch

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

Overview

A condition type that checks whether a log message in the scoping project ( https://cloud.google.com/monitoring/api/v3#project_name) satisfies the given filter. Logs from other projects in the metrics scope are not evaluated.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ LogMatch

Returns a new instance of LogMatch.



2686
2687
2688
# File 'lib/google/apis/monitoring_v3/classes.rb', line 2686

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

Instance Attribute Details

#filterString

Required. A logs-based filter. See Advanced Logs Queries (https://cloud.google. com/logging/docs/view/advanced-queries) for how this filter should be constructed. Corresponds to the JSON property filter

Returns:

  • (String)


2671
2672
2673
# File 'lib/google/apis/monitoring_v3/classes.rb', line 2671

def filter
  @filter
end

#label_extractorsHash<String,String>

Optional. A map from a label key to an extractor expression, which is used to extract the value for this label key. Each entry in this map is a specification for how data should be extracted from log entries that match filter. Each combination of extracted values is treated as a separate rule for the purposes of triggering notifications. Label keys and corresponding values can be used in notifications generated by this condition.Please see the documentation on logs-based metric valueExtractors (https://cloud.google.com/ logging/docs/reference/v2/rest/v2/projects.metrics#LogMetric.FIELDS. value_extractor) for syntax and examples. Corresponds to the JSON property labelExtractors

Returns:

  • (Hash<String,String>)


2684
2685
2686
# File 'lib/google/apis/monitoring_v3/classes.rb', line 2684

def label_extractors
  @label_extractors
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



2691
2692
2693
2694
# File 'lib/google/apis/monitoring_v3/classes.rb', line 2691

def update!(**args)
  @filter = args[:filter] if args.key?(:filter)
  @label_extractors = args[:label_extractors] if args.key?(:label_extractors)
end