Class CfnMetricFilter
java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.CfnElement
software.amazon.awscdk.CfnRefElement
software.amazon.awscdk.CfnResource
software.amazon.awscdk.services.logs.CfnMetricFilter
- All Implemented Interfaces:
IInspectable
,software.amazon.jsii.JsiiSerializable
,software.constructs.IConstruct
,software.constructs.IDependable
@Generated(value="jsii-pacmak/1.98.0 (build 00b106d)",
date="2024-05-08T21:35:09.577Z")
@Stability(Stable)
public class CfnMetricFilter
extends CfnResource
implements IInspectable
The
AWS::Logs::MetricFilter
resource specifies a metric filter that describes how CloudWatch Logs extracts information from logs and transforms it into Amazon CloudWatch metrics.
If you have multiple metric filters that are associated with a log group, all the filters are applied to the log streams in that group.
The maximum number of metric filters that can be associated with a log group is 100.
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.*; CfnMetricFilter cfnMetricFilter = CfnMetricFilter.Builder.create(this, "MyCfnMetricFilter") .filterPattern("filterPattern") .logGroupName("logGroupName") .metricTransformations(List.of(MetricTransformationProperty.builder() .metricName("metricName") .metricNamespace("metricNamespace") .metricValue("metricValue") // the properties below are optional .defaultValue(123) .dimensions(List.of(DimensionProperty.builder() .key("key") .value("value") .build())) .unit("unit") .build())) // the properties below are optional .filterName("filterName") .build();
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
A fluent builder forCfnMetricFilter
.static interface
Specifies the CloudWatch metric dimensions to publish with this metric.static interface
MetricTransformation
is a property of theAWS::Logs::MetricFilter
resource that describes how to transform log streams into a CloudWatch metric.Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationMode
Nested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$Default
Nested classes/interfaces inherited from interface software.amazon.awscdk.IInspectable
IInspectable.Jsii$Default, IInspectable.Jsii$Proxy
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
The CloudFormation resource type name for this resource class. -
Constructor Summary
ModifierConstructorDescriptionprotected
CfnMetricFilter
(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protected
CfnMetricFilter
(software.amazon.jsii.JsiiObjectRef objRef) CfnMetricFilter
(software.constructs.Construct scope, String id, CfnMetricFilterProps props) -
Method Summary
Modifier and TypeMethodDescriptionThe name of the metric filter.A filter pattern for extracting metric data out of ingested log events.The name of an existing log group that you want to associate with this metric filter.The metric transformations.void
inspect
(TreeInspector inspector) Examines the CloudFormation resource and discloses attributes.renderProperties
(Map<String, Object> props) void
setFilterName
(String value) The name of the metric filter.void
setFilterPattern
(String value) A filter pattern for extracting metric data out of ingested log events.void
setLogGroupName
(String value) The name of an existing log group that you want to associate with this metric filter.void
setMetricTransformations
(List<Object> value) The metric transformations.void
The metric transformations.Methods inherited from class software.amazon.awscdk.CfnResource
addDeletionOverride, addDependency, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getAtt, getCfnOptions, getCfnResourceType, getMetadata, getUpdatedProperites, getUpdatedProperties, isCfnResource, obtainDependencies, obtainResourceDependencies, removeDependency, replaceDependency, shouldSynthesize, toString, validateProperties
Methods inherited from class software.amazon.awscdk.CfnRefElement
getRef
Methods inherited from class software.amazon.awscdk.CfnElement
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalId
Methods inherited from class software.constructs.Construct
getNode, isConstruct
Methods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Field Details
-
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
-
-
Constructor Details
-
CfnMetricFilter
protected CfnMetricFilter(software.amazon.jsii.JsiiObjectRef objRef) -
CfnMetricFilter
protected CfnMetricFilter(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
CfnMetricFilter
@Stability(Stable) public CfnMetricFilter(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull CfnMetricFilterProps props) - Parameters:
scope
- Scope in which this resource is defined. This parameter is required.id
- Construct identifier for this resource (unique in its scope). This parameter is required.props
- Resource properties. This parameter is required.
-
-
Method Details
-
inspect
Examines the CloudFormation resource and discloses attributes.- Specified by:
inspect
in interfaceIInspectable
- Parameters:
inspector
- tree inspector to collect and process attributes. This parameter is required.
-
renderProperties
@Stability(Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String, Object> props) - Overrides:
renderProperties
in classCfnResource
- Parameters:
props
- This parameter is required.
-
getCfnProperties
- Overrides:
getCfnProperties
in classCfnResource
-
getFilterPattern
A filter pattern for extracting metric data out of ingested log events. -
setFilterPattern
A filter pattern for extracting metric data out of ingested log events. -
getLogGroupName
The name of an existing log group that you want to associate with this metric filter. -
setLogGroupName
The name of an existing log group that you want to associate with this metric filter. -
getMetricTransformations
The metric transformations. -
setMetricTransformations
The metric transformations. -
setMetricTransformations
The metric transformations. -
getFilterName
The name of the metric filter. -
setFilterName
The name of the metric filter.
-