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.
Idaws.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.

Methods

NameAccessible byRequired Params
create_resourceINSERT, region
delete_resourceDELETEdata__Identifier, region
update_resourceUPDATEdata__Identifier, data__PatchDocument, region
list_resourcesSELECTregion
get_resourceSELECTdata__Identifier, region

SELECT examples

Gets all log_anomaly_detectors in a region.

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 aws.logs.log_anomaly_detectors
WHERE region = 'us-east-1';

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 aws.logs.log_anomaly_detectors
WHERE region = 'us-east-1' AND data__Identifier = '<AnomalyDetectorArn>';

INSERT example

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

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

DELETE example

/*+ delete */
DELETE FROM aws.logs.log_anomaly_detectors
WHERE data__Identifier = '<AnomalyDetectorArn>'
AND region = 'us-east-1';

Permissions

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

Create

logs:CreateLogAnomalyDetector

Read

logs:GetLogAnomalyDetector

Update

logs:UpdateLogAnomalyDetector

Delete

logs:DeleteLogAnomalyDetector

List

logs:ListLogAnomalyDetectors