Skip to main content

log_anomaly_detectors

Creates, updates, deletes or gets a log_anomaly_detector resource or lists log_anomaly_detectors in a region

Overview

Namelog_anomaly_detectors
TypeResource
DescriptionThe AWS::Logs::LogAnomalyDetector resource specifies a CloudWatch Logs LogAnomalyDetector.
Idawscc.logs.log_anomaly_detectors

Fields

NameDatatypeDescription
account_idstringAccount ID for owner of detector
kms_key_idstringThe Amazon Resource Name (ARN) of the CMK to use when encrypting log data.
detector_namestringName of detector
log_group_arn_listarrayList of Arns for the given log group
evaluation_frequencystringHow often log group is evaluated
filter_patternstring
anomaly_detector_statusstringCurrent status of detector.
anomaly_visibility_timenumber
creation_time_stampnumberWhen detector was created.
last_modified_time_stampnumberWhen detector was lsat modified.
anomaly_detector_arnstringARN of LogAnomalyDetector
regionstringAWS region.

For more information, see AWS::Logs::LogAnomalyDetector.

Methods

NameResourceAccessible byRequired Params
create_resourcelog_anomaly_detectorsINSERT, region
delete_resourcelog_anomaly_detectorsDELETEIdentifier, region
update_resourcelog_anomaly_detectorsUPDATEIdentifier, PatchDocument, region
list_resourceslog_anomaly_detectors_list_onlySELECTregion
get_resourcelog_anomaly_detectorsSELECTIdentifier, region

SELECT examples

Gets all properties from an individual log_anomaly_detector.

SELECT
region,
account_id,
kms_key_id,
detector_name,
log_group_arn_list,
evaluation_frequency,
filter_pattern,
anomaly_detector_status,
anomaly_visibility_time,
creation_time_stamp,
last_modified_time_stamp,
anomaly_detector_arn
FROM awscc.logs.log_anomaly_detectors
WHERE
region = 'us-east-1' AND
Identifier = '{{ anomaly_detector_arn }}';

INSERT example

Use the following StackQL query and manifest file to create a new log_anomaly_detector resource, using stack-deploy.

/*+ create */
INSERT INTO awscc.logs.log_anomaly_detectors (
,
region
)
SELECT
'{{ }}',
'{{ region }}';

UPDATE example

Use the following StackQL query and manifest file to update a log_anomaly_detector resource, using stack-deploy.

/*+ update */
UPDATE awscc.logs.log_anomaly_detectors
SET PatchDocument = string('{{ {
"AccountId": account_id,
"KmsKeyId": kms_key_id,
"DetectorName": detector_name,
"LogGroupArnList": log_group_arn_list,
"EvaluationFrequency": evaluation_frequency,
"FilterPattern": filter_pattern,
"AnomalyVisibilityTime": anomaly_visibility_time
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ anomaly_detector_arn }}';

DELETE example

/*+ delete */
DELETE FROM awscc.logs.log_anomaly_detectors
WHERE
Identifier = '{{ anomaly_detector_arn }}' AND
region = 'us-east-1';

Permissions

To operate on the log_anomaly_detectors resource, the following permissions are required:

logs:CreateLogAnomalyDetector