Interface MetricFilterOptions

All Superinterfaces:
software.amazon.jsii.JsiiSerializable
All Known Subinterfaces:
MetricFilterProps
All Known Implementing Classes:
MetricFilterOptions.Jsii$Proxy, MetricFilterProps.Jsii$Proxy

@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)", date="2023-06-19T16:30:38.128Z") @Stability(Stable) public interface MetricFilterOptions extends software.amazon.jsii.JsiiSerializable
Properties for a MetricFilter created from a LogGroup.

Example:

 // The code below shows an example of how to instantiate this type.
 // The values are placeholders you should change.
 import software.amazon.awscdk.services.logs.*;
 IFilterPattern filterPattern;
 MetricFilterOptions metricFilterOptions = MetricFilterOptions.builder()
         .filterPattern(filterPattern)
         .metricName("metricName")
         .metricNamespace("metricNamespace")
         // the properties below are optional
         .defaultValue(123)
         .metricValue("metricValue")
         .build();
 
  • Method Details

    • getFilterPattern

      @Stability(Stable) @NotNull IFilterPattern getFilterPattern()
      Pattern to search for log events.
    • getMetricName

      @Stability(Stable) @NotNull String getMetricName()
      The name of the metric to emit.
    • getMetricNamespace

      @Stability(Stable) @NotNull String getMetricNamespace()
      The namespace of the metric to emit.
    • getDefaultValue

      @Stability(Stable) @Nullable default Number getDefaultValue()
      The value to emit if the pattern does not match a particular event.

      Default: No metric emitted.

    • getMetricValue

      @Stability(Stable) @Nullable default String getMetricValue()
      The value to emit for the metric.

      Can either be a literal number (typically "1"), or the name of a field in the structure to take the value from the matched event. If you are using a field value, the field value must have been matched using the pattern.

      If you want to specify a field from a matched JSON structure, use '$.fieldName', and make sure the field is in the pattern (if only as '$.fieldName = *').

      If you want to specify a field from a matched space-delimited structure, use '$fieldName'.

      Default: "1"

    • builder

      @Stability(Stable) static MetricFilterOptions.Builder builder()
      Returns:
      a MetricFilterOptions.Builder of MetricFilterOptions