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();
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final classA builder forMetricFilterOptionsstatic final classAn implementation forMetricFilterOptions -
Method Summary
Modifier and TypeMethodDescriptionstatic MetricFilterOptions.Builderbuilder()default NumberThe value to emit if the pattern does not match a particular event.Pattern to search for log events.The name of the metric to emit.The namespace of the metric to emit.default StringThe value to emit for the metric.Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Method Details
-
getFilterPattern
Pattern to search for log events. -
getMetricName
The name of the metric to emit. -
getMetricNamespace
The namespace of the metric to emit. -
getDefaultValue
The value to emit if the pattern does not match a particular event.Default: No metric emitted.
-
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
- Returns:
- a
MetricFilterOptions.BuilderofMetricFilterOptions
-