Class CfnLogAnomalyDetector
Creates or updates an anomaly detector that regularly scans one or more log groups and look for patterns and anomalies in the logs.
Implements
Inherited Members
Namespace: Amazon.CDK.AWS.Logs
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class CfnLogAnomalyDetector : CfnResource, IInspectable
Syntax (vb)
Public Class CfnLogAnomalyDetector
Inherits CfnResource
Implements IInspectable
Remarks
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 .
CloudformationResource: AWS::Logs::LogAnomalyDetector
ExampleMetadata: fixture=_generated
Examples
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.Logs;
var cfnLogAnomalyDetector = new CfnLogAnomalyDetector(this, "MyCfnLogAnomalyDetector", new CfnLogAnomalyDetectorProps {
AccountId = "accountId",
AnomalyVisibilityTime = 123,
DetectorName = "detectorName",
EvaluationFrequency = "evaluationFrequency",
FilterPattern = "filterPattern",
KmsKeyId = "kmsKeyId",
LogGroupArnList = new [] { "logGroupArnList" }
});
Synopsis
Constructors
CfnLogAnomalyDetector(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
CfnLogAnomalyDetector(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
CfnLogAnomalyDetector(Construct, String, ICfnLogAnomalyDetectorProps) |
Properties
AccountId | The ID of the account to create the anomaly detector in. |
AnomalyVisibilityTime | The number of days to have visibility on an anomaly. |
AttrAnomalyDetectorArn | The ARN of the anomaly detector. |
AttrAnomalyDetectorStatus | Specifies whether the anomaly detector is currently active. |
AttrCreationTimeStamp | The time that the anomaly detector was created. |
AttrLastModifiedTimeStamp | The time that the anomaly detector was most recently modified. |
CFN_RESOURCE_TYPE_NAME | The CloudFormation resource type name for this resource class. |
CfnProperties | |
DetectorName | A name for this anomaly detector. |
EvaluationFrequency | Specifies how often the anomaly detector is to run and look for anomalies. |
FilterPattern | You can use this parameter to limit the anomaly detection model to examine only log events that match the pattern you specify here. |
KmsKeyId | Optionally assigns a AWS KMS key to secure this anomaly detector and its findings. |
LogGroupArnList | The ARN of the log group that is associated with this anomaly detector. |
Methods
Inspect(TreeInspector) | Examines the CloudFormation resource and discloses attributes. |
RenderProperties(IDictionary<String, Object>) |
Constructors
CfnLogAnomalyDetector(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected CfnLogAnomalyDetector(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
CfnLogAnomalyDetector(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected CfnLogAnomalyDetector(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
CfnLogAnomalyDetector(Construct, String, ICfnLogAnomalyDetectorProps)
public CfnLogAnomalyDetector(Construct scope, string id, ICfnLogAnomalyDetectorProps props = null)
Parameters
- scope Constructs.Construct
Scope in which this resource is defined.
- id System.String
Construct identifier for this resource (unique in its scope).
- props ICfnLogAnomalyDetectorProps
Resource properties.
Properties
AccountId
The ID of the account to create the anomaly detector in.
public virtual string AccountId { get; set; }
Property Value
System.String
AnomalyVisibilityTime
The number of days to have visibility on an anomaly.
public virtual Nullable<double> AnomalyVisibilityTime { get; set; }
Property Value
System.Nullable<System.Double>
AttrAnomalyDetectorArn
The ARN of the anomaly detector.
public virtual string AttrAnomalyDetectorArn { get; }
Property Value
System.String
Remarks
CloudformationAttribute: AnomalyDetectorArn
AttrAnomalyDetectorStatus
Specifies whether the anomaly detector is currently active.
public virtual string AttrAnomalyDetectorStatus { get; }
Property Value
System.String
Remarks
CloudformationAttribute: AnomalyDetectorStatus
AttrCreationTimeStamp
The time that the anomaly detector was created.
public virtual IResolvable AttrCreationTimeStamp { get; }
Property Value
Remarks
CloudformationAttribute: CreationTimeStamp
AttrLastModifiedTimeStamp
The time that the anomaly detector was most recently modified.
public virtual IResolvable AttrLastModifiedTimeStamp { get; }
Property Value
Remarks
CloudformationAttribute: LastModifiedTimeStamp
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
public static string CFN_RESOURCE_TYPE_NAME { get; }
Property Value
System.String
CfnProperties
protected override IDictionary<string, object> CfnProperties { get; }
Property Value
System.Collections.Generic.IDictionary<System.String, System.Object>
Overrides
DetectorName
A name for this anomaly detector.
public virtual string DetectorName { get; set; }
Property Value
System.String
EvaluationFrequency
Specifies how often the anomaly detector is to run and look for anomalies.
public virtual string EvaluationFrequency { get; set; }
Property Value
System.String
FilterPattern
You can use this parameter to limit the anomaly detection model to examine only log events that match the pattern you specify here.
public virtual string FilterPattern { get; set; }
Property Value
System.String
KmsKeyId
Optionally assigns a AWS KMS key to secure this anomaly detector and its findings.
public virtual string KmsKeyId { get; set; }
Property Value
System.String
LogGroupArnList
The ARN of the log group that is associated with this anomaly detector.
public virtual string[] LogGroupArnList { get; set; }
Property Value
System.String[]
Methods
Inspect(TreeInspector)
Examines the CloudFormation resource and discloses attributes.
public virtual void Inspect(TreeInspector inspector)
Parameters
- inspector TreeInspector
tree inspector to collect and process attributes.
RenderProperties(IDictionary<String, Object>)
protected override IDictionary<string, object> RenderProperties(IDictionary<string, object> props)
Parameters
- props System.Collections.Generic.IDictionary<System.String, System.Object>
Returns
System.Collections.Generic.IDictionary<System.String, System.Object>