Class CfnLogAnomalyDetector

java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
All Implemented Interfaces:
IInspectable, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct, software.constructs.IDependable

@Generated(value="jsii-pacmak/1.103.1 (build bef2dea)", date="2024-10-05T03:43:45.905Z") @Stability(Stable) public class CfnLogAnomalyDetector extends CfnResource implements IInspectable
Creates or updates an anomaly detector that regularly scans one or more log groups and look for patterns and anomalies in the logs.

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:
  • Field Details

    • CFN_RESOURCE_TYPE_NAME

      @Stability(Stable) public static final String 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

      @Stability(Stable) public void inspect(@NotNull TreeInspector inspector)
      Examines the CloudFormation resource and discloses attributes.

      Specified by:
      inspect in interface IInspectable
      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 class CfnResource
      Parameters:
      props - This parameter is required.
    • getAttrAnomalyDetectorArn

      @Stability(Stable) @NotNull public String getAttrAnomalyDetectorArn()
      The ARN of the anomaly detector.
    • getAttrAnomalyDetectorStatus

      @Stability(Stable) @NotNull public String getAttrAnomalyDetectorStatus()
      Specifies whether the anomaly detector is currently active.
    • getAttrCreationTimeStamp

      @Stability(Stable) @NotNull public IResolvable getAttrCreationTimeStamp()
      The time that the anomaly detector was created.
    • getAttrLastModifiedTimeStamp

      @Stability(Stable) @NotNull public IResolvable getAttrLastModifiedTimeStamp()
      The time that the anomaly detector was most recently modified.
    • getCfnProperties

      @Stability(Stable) @NotNull protected Map<String,Object> getCfnProperties()
      Overrides:
      getCfnProperties in class CfnResource
    • getAccountId

      @Stability(Stable) @Nullable public String getAccountId()
      The ID of the account to create the anomaly detector in.
    • setAccountId

      @Stability(Stable) public void setAccountId(@Nullable String value)
      The ID of the account to create the anomaly detector in.
    • getAnomalyVisibilityTime

      @Stability(Stable) @Nullable public Number getAnomalyVisibilityTime()
      The number of days to have visibility on an anomaly.
    • setAnomalyVisibilityTime

      @Stability(Stable) public void setAnomalyVisibilityTime(@Nullable Number value)
      The number of days to have visibility on an anomaly.
    • getDetectorName

      @Stability(Stable) @Nullable public String getDetectorName()
      A name for this anomaly detector.
    • setDetectorName

      @Stability(Stable) public void setDetectorName(@Nullable String value)
      A name for this anomaly detector.
    • getEvaluationFrequency

      @Stability(Stable) @Nullable public String getEvaluationFrequency()
      Specifies how often the anomaly detector is to run and look for anomalies.
    • setEvaluationFrequency

      @Stability(Stable) public void setEvaluationFrequency(@Nullable String value)
      Specifies how often the anomaly detector is to run and look for anomalies.
    • getFilterPattern

      @Stability(Stable) @Nullable public String 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

      @Stability(Stable) public void setFilterPattern(@Nullable 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.
    • getKmsKeyId

      @Stability(Stable) @Nullable public String getKmsKeyId()
      Optionally assigns a AWS KMS key to secure this anomaly detector and its findings.
    • setKmsKeyId

      @Stability(Stable) public void setKmsKeyId(@Nullable String value)
      Optionally assigns a AWS KMS key to secure this anomaly detector and its findings.
    • getLogGroupArnList

      @Stability(Stable) @Nullable public List<String> getLogGroupArnList()
      The ARN of the log group that is associated with this anomaly detector.
    • setLogGroupArnList

      @Stability(Stable) public void setLogGroupArnList(@Nullable List<String> value)
      The ARN of the log group that is associated with this anomaly detector.