Skip to main content

anomalies

Creates, updates, deletes, gets or lists an anomalies resource.

Overview

Nameanomalies
TypeResource
Idaws.logs.anomalies

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
activebooleanSpecifies whether this anomaly is still ongoing.
anomaly_detector_arnstringThe ARN of the anomaly detector that identified this anomaly. (pattern: <code>[\w#+=/:,.@-]*</code>)
anomaly_idstringThe unique ID that CloudWatch Logs assigned to this anomaly.
descriptionstringA human-readable description of the anomaly. This description is generated by CloudWatch Logs.
first_seeninteger (int64)The date and time when the anomaly detector first saw this anomaly. It is specified as epoch time, which is the number of seconds since January 1, 1970, 00:00:00 UTC.
histogramobjectA map showing times when the anomaly detector ran, and the number of occurrences of this anomaly that were detected at each of those runs. The times are specified in epoch time, which is the number of seconds since January 1, 1970, 00:00:00 UTC.
is_pattern_level_suppressionbooleanIf this anomaly is suppressed, this field is true if the suppression is because the pattern is suppressed. If false, then only this particular anomaly is suppressed.
last_seeninteger (int64)The date and time when the anomaly detector most recently saw this anomaly. It is specified as epoch time, which is the number of seconds since January 1, 1970, 00:00:00 UTC.
log_group_arn_listarrayAn array of ARNS of the log groups that contained log events considered to be part of this anomaly.
log_samplesarrayAn array of sample log event messages that are considered to be part of this anomaly.
pattern_idstringThe ID of the pattern used to help identify this anomaly.
pattern_regexstringThe pattern used to help identify this anomaly, in regular expression format.
pattern_stringstringThe pattern used to help identify this anomaly, in string format.
pattern_tokensarrayAn array of structures where each structure contains information about one token that makes up the pattern.
prioritystringThe priority level of this anomaly, as determined by CloudWatch Logs. Priority is computed based on log severity labels such as FATAL and ERROR and the amount of deviation from the baseline. Possible values are HIGH, MEDIUM, and LOW.
statestringIndicates the current state of this anomaly. If it is still being treated as an anomaly, the value is Active. If you have suppressed this anomaly by using the UpdateAnomaly operation, the value is Suppressed. If this behavior is now considered to be normal, the value is Baseline. (Active, Suppressed, Baseline)
suppressedbooleanIndicates whether this anomaly is currently suppressed. To suppress an anomaly, use UpdateAnomaly.
suppressed_dateinteger (int64)If the anomaly is suppressed, this indicates when it was suppressed.
suppressed_untilinteger (int64)If the anomaly is suppressed, this indicates when the suppression will end. If this value is 0, the anomaly was suppressed with no expiration, with the INFINITE value.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
list_anomaliesselectregionReturns a list of anomalies that log anomaly detectors have found. For details about the structure format of each anomaly object that is returned, see the example in this section.
update_anomalyupdateregion, anomalyDetectorArnUse this operation to suppress anomaly detection for a specified anomaly or pattern. If you suppress an anomaly, CloudWatch Logs won't report new occurrences of that anomaly and won't update that anomaly with new data. If you suppress a pattern, CloudWatch Logs won't report any anomalies related to that pattern. You must specify either anomalyId or patternId, but you can't specify both parameters in the same operation. If you have previously used this operation to suppress detection of a pattern or anomaly, you can use it again to cause CloudWatch Logs to end the suppression. To do this, use this operation and specify the anomaly or pattern to stop suppressing, and omit the suppressionType and suppressionPeriod parameters.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
regionstringAWS region (default: us-east-1)

SELECT examples

Returns a list of anomalies that log anomaly detectors have found. For details about the structure format of each anomaly object that is returned, see the example in this section.

SELECT
active,
anomaly_detector_arn,
anomaly_id,
description,
first_seen,
histogram,
is_pattern_level_suppression,
last_seen,
log_group_arn_list,
log_samples,
pattern_id,
pattern_regex,
pattern_string,
pattern_tokens,
priority,
state,
suppressed,
suppressed_date,
suppressed_until
FROM aws.logs.anomalies
WHERE region = '{{ region }}' -- required
;

UPDATE examples

Use this operation to suppress anomaly detection for a specified anomaly or pattern. If you suppress an anomaly, CloudWatch Logs won't report new occurrences of that anomaly and won't update that anomaly with new data. If you suppress a pattern, CloudWatch Logs won't report any anomalies related to that pattern. You must specify either anomalyId or patternId, but you can't specify both parameters in the same operation. If you have previously used this operation to suppress detection of a pattern or anomaly, you can use it again to cause CloudWatch Logs to end the suppression. To do this, use this operation and specify the anomaly or pattern to stop suppressing, and omit the suppressionType and suppressionPeriod parameters.

UPDATE aws.logs.anomalies
SET
anomalyId = '{{ anomalyId }}',
patternId = '{{ patternId }}',
anomalyDetectorArn = '{{ anomalyDetectorArn }}',
suppressionType = '{{ suppressionType }}',
suppressionPeriod = '{{ suppressionPeriod }}',
baseline = {{ baseline }}
WHERE
region = '{{ region }}' --required
AND anomalyDetectorArn = '{{ anomalyDetectorArn }}' --required;