Class MetricFilterOptions.Builder
java.lang.Object
software.amazon.awscdk.services.logs.MetricFilterOptions.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<MetricFilterOptions>
- Enclosing interface:
- MetricFilterOptions
@Stability(Stable)
public static final class MetricFilterOptions.Builder
extends Object
implements software.amazon.jsii.Builder<MetricFilterOptions>
A builder for
MetricFilterOptions
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds the configured instance.defaultValue
(Number defaultValue) Sets the value ofMetricFilterOptions.getDefaultValue()
filterPattern
(IFilterPattern filterPattern) Sets the value ofMetricFilterOptions.getFilterPattern()
metricName
(String metricName) Sets the value ofMetricFilterOptions.getMetricName()
metricNamespace
(String metricNamespace) Sets the value ofMetricFilterOptions.getMetricNamespace()
metricValue
(String metricValue) Sets the value ofMetricFilterOptions.getMetricValue()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
filterPattern
Sets the value ofMetricFilterOptions.getFilterPattern()
- Parameters:
filterPattern
- Pattern to search for log events. This parameter is required.- Returns:
this
-
metricName
Sets the value ofMetricFilterOptions.getMetricName()
- Parameters:
metricName
- The name of the metric to emit. This parameter is required.- Returns:
this
-
metricNamespace
Sets the value ofMetricFilterOptions.getMetricNamespace()
- Parameters:
metricNamespace
- The namespace of the metric to emit. This parameter is required.- Returns:
this
-
defaultValue
Sets the value ofMetricFilterOptions.getDefaultValue()
- Parameters:
defaultValue
- The value to emit if the pattern does not match a particular event.- Returns:
this
-
metricValue
Sets the value ofMetricFilterOptions.getMetricValue()
- Parameters:
metricValue
- 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'.
- Returns:
this
-
build
Builds the configured instance.- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<MetricFilterOptions>
- Returns:
- a new instance of
MetricFilterOptions
- Throws:
NullPointerException
- if any required attribute was not provided
-