Skip to content

CloudWatchLogsClient.create_log_anomaly_detector

rboto-cloudwatch-logs==0.4.0 · Service index · Types

Model summary (excerpt): Creates 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....

Install and imports

python -m pip install "rboto[cloudwatch-logs]==0.4.0"
from rboto import CloudWatchLogsClient
from collections.abc import Sequence
from rboto_cloudwatch_logs.types import (
    CreateLogAnomalyDetectorOutput,
    EvaluationFrequency,
)

Signature

async def create_log_anomaly_detector(
    *,
    log_group_arn_list: Sequence[str],
    detector_name: str | None = None,
    evaluation_frequency: EvaluationFrequency | None = None,
    filter_pattern: str | None = None,
    kms_key_id: str | None = None,
    anomaly_visibility_time: int | None = None,
    tags: dict[str, str] | None = None,
) -> CreateLogAnomalyDetectorOutput: ...

Arguments without defaults are required. None omits an optional request argument. Static types do not validate resource existence, permissions, lengths, ranges, or conditional service requirements.

Arguments

Argument Required Model notes (excerpt)
log_group_arn_list Yes An array containing the ARN of the log group that this anomaly detector will watch. You can specify only one log group ARN.
detector_name No A name for this anomaly detector.
evaluation_frequency No Specifies how often the anomaly detector is to run and look for anomalies. Set this value according to the frequency that the log group receives new logs. For example, if the log group receives new log events every 10 minutes, then 15 minutes might be a good setting for evaluationFrequency .
filter_pattern No You can use this parameter to limit the anomaly detection model to examine only log events that match the pattern you specify here. For more information, see Filter and Pattern Syntax .
kms_key_id No Optionally assigns a KMS key to secure this anomaly detector and its findings. If a key is assigned, the anomalies found and the model used by this detector are encrypted at rest with the key. If a key is assigned to an anomaly detector, a user must have permissions for both this key and for the anomaly detector to retrieve information about the anomalies that it finds. Make sure the value...
anomaly_visibility_time No The number of days to have visibility on an anomaly. After this time period has elapsed for an anomaly, it will be automatically baselined and the anomaly detector will treat new occurrences of a similar anomaly as normal. Therefore, if you do not correct the cause of an anomaly during the time period specified in anomalyVisibilityTime , it will be considered normal going forward and will not...
tags No An optional list of key-value pairs to associate with the resource. For more information about tagging, see Tagging Amazon Web Services resources

Output

CreateLogAnomalyDetectorOutput.

Read-only native attributes, accessed as response.field. Collection getters materialize Python values; to_dict() recursively materializes a mapping. Streams are consumed once.

Field Type Presence References
anomaly_detector_arn str | None Always present —

| None means a value can be absent. Output mappings include every declared key; optional input keys may be omitted. Unknown output enum/union variants are not automatically valid inputs.

CreateLogAnomalyDetectorOutput, EvaluationFrequency

Follow these links for nested inputs and outputs; recursive types link back to the same type page.

Pagination and streaming

No generated paginator for this operation.

No output stream.

Errors

Import from rboto_cloudwatch_logs.exceptions:

InvalidParameterError, LimitExceededError, OperationAbortedError, ResourceNotFoundError, ServiceUnavailableError.

Other service failures use the service base error; credential, transport and timeout failures use shared errors.

Service guide · Pinned model