Class: AWSCDK::Logs::CfnMetricFilterProps

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
logs/cfn_metric_filter_props.rb

Overview

Properties for defining a CfnMetricFilter.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(filter_pattern:, log_group_name:, metric_transformations:, apply_on_transformed_logs: nil, emit_system_field_dimensions: nil, field_selection_criteria: nil, filter_name: nil) ⇒ CfnMetricFilterProps

Returns a new instance of CfnMetricFilterProps.

Parameters:

  • filter_pattern (String)

    A filter pattern for extracting metric data out of ingested log events.

  • log_group_name (String, AWSCDK::Interfaces::AWSLogs::ILogGroupRef)

    The name of an existing log group that you want to associate with this metric filter.

  • metric_transformations (AWSCDK::IResolvable, Array<AWSCDK::IResolvable, AWSCDK::Logs::CfnMetricFilter::MetricTransformationProperty>)

    The metric transformations.

  • apply_on_transformed_logs (Boolean, AWSCDK::IResolvable, nil) (defaults to: nil)

    This parameter is valid only for log groups that have an active log transformer.

  • emit_system_field_dimensions (Array<String>, nil) (defaults to: nil)

    The list of system fields that are emitted as additional dimensions in the generated metrics.

  • field_selection_criteria (String, nil) (defaults to: nil)

    The filter expression that specifies which log events are processed by this metric filter based on system fields.

  • filter_name (String, nil) (defaults to: nil)

    The name of the metric filter.



16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'logs/cfn_metric_filter_props.rb', line 16

def initialize(filter_pattern:, log_group_name:, metric_transformations:, apply_on_transformed_logs: nil, emit_system_field_dimensions: nil, field_selection_criteria: nil, filter_name: nil)
  @filter_pattern = filter_pattern
  Jsii::Type.check_type(@filter_pattern, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "filterPattern")
  @log_group_name = log_group_name
  Jsii::Type.check_type(@log_group_name, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3sicHJpbWl0aXZlIjoic3RyaW5nIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5pbnRlcmZhY2VzLmF3c19sb2dzLklMb2dHcm91cFJlZiJ9XX19")), "logGroupName")
  @metric_transformations = metric_transformations
  Jsii::Type.check_type(@metric_transformations, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImNvbGxlY3Rpb24iOnsiZWxlbWVudHR5cGUiOnsidW5pb24iOnsidHlwZXMiOlt7ImZxbiI6ImF3cy1jZGstbGliLklSZXNvbHZhYmxlIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfbG9ncy5DZm5NZXRyaWNGaWx0ZXIuTWV0cmljVHJhbnNmb3JtYXRpb25Qcm9wZXJ0eSJ9XX19LCJraW5kIjoiYXJyYXkifX1dfX0=")), "metricTransformations")
  @apply_on_transformed_logs = apply_on_transformed_logs
  Jsii::Type.check_type(@apply_on_transformed_logs, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3sicHJpbWl0aXZlIjoiYm9vbGVhbiJ9LHsiZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifV19fQ==")), "applyOnTransformedLogs") unless @apply_on_transformed_logs.nil?
  @emit_system_field_dimensions = emit_system_field_dimensions
  Jsii::Type.check_type(@emit_system_field_dimensions, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "emitSystemFieldDimensions") unless @emit_system_field_dimensions.nil?
  @field_selection_criteria = field_selection_criteria
  Jsii::Type.check_type(@field_selection_criteria, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "fieldSelectionCriteria") unless @field_selection_criteria.nil?
  @filter_name = filter_name
  Jsii::Type.check_type(@filter_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "filterName") unless @filter_name.nil?
end

Instance Attribute Details

#apply_on_transformed_logsBoolean, ... (readonly)

This parameter is valid only for log groups that have an active log transformer.

For more information about log transformers, see PutTransformer .

If this value is true , the metric filter is applied on the transformed version of the log events instead of the original ingested log events.



58
59
60
# File 'logs/cfn_metric_filter_props.rb', line 58

def apply_on_transformed_logs
  @apply_on_transformed_logs
end

#emit_system_field_dimensionsArray<String>? (readonly)

The list of system fields that are emitted as additional dimensions in the generated metrics.

Returns the emit_system_field_dimensions value if it was specified when the metric filter was created.



65
66
67
# File 'logs/cfn_metric_filter_props.rb', line 65

def emit_system_field_dimensions
  @emit_system_field_dimensions
end

#field_selection_criteriaString? (readonly)

The filter expression that specifies which log events are processed by this metric filter based on system fields.

Returns the field_selection_criteria value if it was specified when the metric filter was created.



72
73
74
# File 'logs/cfn_metric_filter_props.rb', line 72

def field_selection_criteria
  @field_selection_criteria
end

#filter_nameString? (readonly)

The name of the metric filter.



77
78
79
# File 'logs/cfn_metric_filter_props.rb', line 77

def filter_name
  @filter_name
end

#filter_patternString (readonly)

A filter pattern for extracting metric data out of ingested log events.

For more information, see Filter and Pattern Syntax .



39
40
41
# File 'logs/cfn_metric_filter_props.rb', line 39

def filter_pattern
  @filter_pattern
end

#log_group_nameString, AWSCDK::Interfaces::AWSLogs::ILogGroupRef (readonly)

The name of an existing log group that you want to associate with this metric filter.



44
45
46
# File 'logs/cfn_metric_filter_props.rb', line 44

def log_group_name
  @log_group_name
end

#metric_transformationsAWSCDK::IResolvable, Array<AWSCDK::IResolvable, AWSCDK::Logs::CfnMetricFilter::MetricTransformationProperty> (readonly)

The metric transformations.



49
50
51
# File 'logs/cfn_metric_filter_props.rb', line 49

def metric_transformations
  @metric_transformations
end

Class Method Details

.jsii_propertiesObject



79
80
81
82
83
84
85
86
87
88
89
# File 'logs/cfn_metric_filter_props.rb', line 79

def self.jsii_properties
  {
    :filter_pattern => "filterPattern",
    :log_group_name => "logGroupName",
    :metric_transformations => "metricTransformations",
    :apply_on_transformed_logs => "applyOnTransformedLogs",
    :emit_system_field_dimensions => "emitSystemFieldDimensions",
    :field_selection_criteria => "fieldSelectionCriteria",
    :filter_name => "filterName",
  }
end

Instance Method Details

#to_jsiiObject



91
92
93
94
95
96
97
98
99
100
101
102
103
# File 'logs/cfn_metric_filter_props.rb', line 91

def to_jsii
  result = {}
  result.merge!({
    "filterPattern" => @filter_pattern,
    "logGroupName" => @log_group_name,
    "metricTransformations" => @metric_transformations,
    "applyOnTransformedLogs" => @apply_on_transformed_logs,
    "emitSystemFieldDimensions" => @emit_system_field_dimensions,
    "fieldSelectionCriteria" => @field_selection_criteria,
    "filterName" => @filter_name,
  })
  result.compact
end