Skip to main content

insight_rules

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

Overview

Nameinsight_rules
TypeResource
Idaws.cloudwatch.insight_rules

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
insight_rulesarrayThe rules returned by the operation.
next_tokenstringIf this parameter is present, it is a token that marks the start of the next batch of returned results.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
describe_insight_rulesselectregionReturns a list of all the Contributor Insights rules in your account. For more information about Contributor Insights, see Using Contributor Insights to Analyze High-Cardinality Data.
put_insight_rulereplaceregion, RuleName, RuleDefinitionCreates a Contributor Insights rule. Rules evaluate log events in a CloudWatch Logs log group, enabling you to find contributor data for the log events in that log group. For more information, see Using Contributor Insights to Analyze High-Cardinality Data. If you create a rule, delete it, and then re-create it with the same name, historical data from the first time the rule was created might not be available.
delete_insight_rulesdeleteregionPermanently deletes the specified Contributor Insights rules. If you create a rule, delete it, and then re-create it with the same name, historical data from the first time the rule was created might not be available.
disable_insight_rulesexecregion, RuleNamesDisables the specified Contributor Insights rules. When rules are disabled, they do not analyze log groups and do not incur costs.
enable_insight_rulesexecregion, RuleNamesEnables the specified Contributor Insights rules. When rules are enabled, they immediately begin analyzing log data.

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 all the Contributor Insights rules in your account. For more information about Contributor Insights, see Using Contributor Insights to Analyze High-Cardinality Data.

SELECT
insight_rules,
next_token
FROM aws.cloudwatch.insight_rules
WHERE region = '{{ region }}' -- required
;

REPLACE examples

Creates a Contributor Insights rule. Rules evaluate log events in a CloudWatch Logs log group, enabling you to find contributor data for the log events in that log group. For more information, see Using Contributor Insights to Analyze High-Cardinality Data. If you create a rule, delete it, and then re-create it with the same name, historical data from the first time the rule was created might not be available.

REPLACE aws.cloudwatch.insight_rules
SET
RuleName = '{{ RuleName }}',
RuleState = '{{ RuleState }}',
RuleDefinition = '{{ RuleDefinition }}',
Tags = '{{ Tags }}',
ApplyOnTransformedLogs = {{ ApplyOnTransformedLogs }}
WHERE
region = '{{ region }}' --required
AND RuleName = '{{ RuleName }}' --required
AND RuleDefinition = '{{ RuleDefinition }}' --required;

DELETE examples

Permanently deletes the specified Contributor Insights rules. If you create a rule, delete it, and then re-create it with the same name, historical data from the first time the rule was created might not be available.

DELETE FROM aws.cloudwatch.insight_rules
WHERE region = '{{ region }}' --required
;

Lifecycle Methods

Disables the specified Contributor Insights rules. When rules are disabled, they do not analyze log groups and do not incur costs.

EXEC aws.cloudwatch.insight_rules.disable_insight_rules
@region='{{ region }}' --required
@@json=
'{
"RuleNames": "{{ RuleNames }}"
}'
;