Class CfnLogAnomalyDetector
- All Implemented Interfaces:
IInspectable
,software.amazon.jsii.JsiiSerializable
,software.constructs.IConstruct
,software.constructs.IDependable
An anomaly detector can help surface issues by automatically discovering anomalies in your log event traffic. An anomaly detector uses machine learning algorithms to scan log events and find patterns . A pattern is a shared text structure that recurs among your log fields. Patterns provide a useful tool for analyzing large sets of logs because a large number of log events can often be compressed into a few patterns.
The anomaly detector uses pattern recognition to find anomalies
, which are unusual log events. It compares current log events and patterns with trained baselines.
Fields within a pattern are called tokens . Fields that vary within a pattern, such as a request ID or timestamp, are referred to as dynamic tokens and represented by <*>
.
For more information see Log anomaly detection .
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.*; CfnLogAnomalyDetector cfnLogAnomalyDetector = CfnLogAnomalyDetector.Builder.create(this, "MyCfnLogAnomalyDetector") .accountId("accountId") .anomalyVisibilityTime(123) .detectorName("detectorName") .evaluationFrequency("evaluationFrequency") .filterPattern("filterPattern") .kmsKeyId("kmsKeyId") .logGroupArnList(List.of("logGroupArnList")) .build();
- See Also:
-
Nested Class Summary
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
CfnLogAnomalyDetector
(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protected
CfnLogAnomalyDetector
(software.amazon.jsii.JsiiObjectRef objRef) CfnLogAnomalyDetector
(software.constructs.Construct scope, String id) CfnLogAnomalyDetector
(software.constructs.Construct scope, String id, CfnLogAnomalyDetectorProps props) -
Method Summary
Modifier and TypeMethodDescriptionThe ID of the account to create the anomaly detector in.The number of days to have visibility on an anomaly.The ARN of the anomaly detector.Specifies whether the anomaly detector is currently active.The time that the anomaly detector was created.The time that the anomaly detector was most recently modified.A name for this anomaly detector.Specifies how often the anomaly detector is to run and look for anomalies.You can use this parameter to limit the anomaly detection model to examine only log events that match the pattern you specify here.Optionally assigns a AWS KMS key to secure this anomaly detector and its findings.The ARN of the log group that is associated with this anomaly detector.void
inspect
(TreeInspector inspector) Examines the CloudFormation resource and discloses attributes.renderProperties
(Map<String, Object> props) void
setAccountId
(String value) The ID of the account to create the anomaly detector in.void
setAnomalyVisibilityTime
(Number value) The number of days to have visibility on an anomaly.void
setDetectorName
(String value) A name for this anomaly detector.void
setEvaluationFrequency
(String value) Specifies how often the anomaly detector is to run and look for anomalies.void
setFilterPattern
(String value) You can use this parameter to limit the anomaly detection model to examine only log events that match the pattern you specify here.void
setKmsKeyId
(String value) Optionally assigns a AWS KMS key to secure this anomaly detector and its findings.void
setLogGroupArnList
(List<String> value) The ARN of the log group that is associated with this anomaly detector.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
-
CfnLogAnomalyDetector
protected CfnLogAnomalyDetector(software.amazon.jsii.JsiiObjectRef objRef) -
CfnLogAnomalyDetector
protected CfnLogAnomalyDetector(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
CfnLogAnomalyDetector
@Stability(Stable) public CfnLogAnomalyDetector(@NotNull software.constructs.Construct scope, @NotNull String id, @Nullable CfnLogAnomalyDetectorProps 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.
-
CfnLogAnomalyDetector
@Stability(Stable) public CfnLogAnomalyDetector(@NotNull software.constructs.Construct scope, @NotNull String id) - 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.
-
-
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.
-
getAttrAnomalyDetectorArn
The ARN of the anomaly detector. -
getAttrAnomalyDetectorStatus
Specifies whether the anomaly detector is currently active. -
getAttrCreationTimeStamp
The time that the anomaly detector was created. -
getAttrLastModifiedTimeStamp
The time that the anomaly detector was most recently modified. -
getCfnProperties
- Overrides:
getCfnProperties
in classCfnResource
-
getAccountId
The ID of the account to create the anomaly detector in. -
setAccountId
The ID of the account to create the anomaly detector in. -
getAnomalyVisibilityTime
The number of days to have visibility on an anomaly. -
setAnomalyVisibilityTime
The number of days to have visibility on an anomaly. -
getDetectorName
A name for this anomaly detector. -
setDetectorName
A name for this anomaly detector. -
getEvaluationFrequency
Specifies how often the anomaly detector is to run and look for anomalies. -
setEvaluationFrequency
Specifies how often the anomaly detector is to run and look for anomalies. -
getFilterPattern
You can use this parameter to limit the anomaly detection model to examine only log events that match the pattern you specify here. -
setFilterPattern
You can use this parameter to limit the anomaly detection model to examine only log events that match the pattern you specify here. -
getKmsKeyId
Optionally assigns a AWS KMS key to secure this anomaly detector and its findings. -
setKmsKeyId
Optionally assigns a AWS KMS key to secure this anomaly detector and its findings. -
getLogGroupArnList
The ARN of the log group that is associated with this anomaly detector. -
setLogGroupArnList
The ARN of the log group that is associated with this anomaly detector.
-