put_insight_rule
async
¶
put_insight_rule(
*,
config_overrides: Optional[AsyncCloudWatchClientConfig] = None,
rule_name: Optional[InsightRuleName] = None,
rule_state: Optional[InsightRuleState] = None,
rule_definition: Optional[InsightRuleDefinition] = None,
tags: Optional[TagList] = None,
apply_on_transformed_logs: Optional[InsightRuleOnTransformedLogs] = None,
) -> PutInsightRuleOutput
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.
Parameters:
-
rule_name(Optional[InsightRuleName], default:None) –A unique name for the rule.
-
rule_state(Optional[InsightRuleState], default:None) –The state of the rule. Valid values are ENABLED and DISABLED.
-
rule_definition(Optional[InsightRuleDefinition], default:None) –The definition of the rule, as a JSON object. For details on the valid syntax, see Contributor Insights Rule Syntax.
-
tags(Optional[TagList], default:None) –A list of key-value pairs to associate with the Contributor Insights rule. You can associate as many as 50 tags with a rule.
Tags can help you organize and categorize your resources. You can also use them to scope user permissions, by granting a user permission to access or change only the resources that have certain tag values.
To be able to associate tags with a rule, you must have the
cloudwatch:TagResourcepermission in addition to thecloudwatch:PutInsightRulepermission.If you are using this operation to update an existing Contributor Insights rule, any tags you specify in this parameter are ignored. To change the tags of an existing rule, use TagResource.
-
apply_on_transformed_logs(Optional[InsightRuleOnTransformedLogs], default:None) –Specify
trueto have this rule evaluate log events after they have been transformed by Log transformation. If you specifytrue, then the log events in log groups that have transformers will be evaluated by Contributor Insights after being transformed. Log groups that don't have transformers will still have their original log events evaluated by Contributor Insights.The default is
falseIf a log group has a transformer, and transformation fails for some log events, those log events won't be evaluated by Contributor Insights. For information about investigating log transformation failures, see Transformation metrics and errors.
Raises:
-
InvalidParameterValueException–The value of an input parameter is bad or out-of-range.
-
LimitExceededException–The operation exceeded one or more limits.
-
MissingRequiredParameterException–An input parameter that is required is missing.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_cloudwatch/_services/async_cloud_watch.py
3080 3081 3082 3083 3084 3085 3086 3087 3088 3089 3090 3091 3092 3093 3094 3095 3096 3097 3098 3099 3100 3101 3102 3103 3104 3105 3106 3107 3108 3109 3110 3111 3112 3113 3114 3115 3116 3117 3118 3119 3120 3121 3122 3123 3124 3125 3126 3127 3128 3129 3130 3131 3132 3133 3134 3135 3136 3137 3138 3139 3140 3141 3142 3143 3144 3145 3146 3147 3148 3149 3150 | |