put_insight_rule
¶
put_insight_rule(
*,
config_overrides: Optional[CloudWatchClientConfig] = 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/cloud_watch.py
3039 3040 3041 3042 3043 3044 3045 3046 3047 3048 3049 3050 3051 3052 3053 3054 3055 3056 3057 3058 3059 3060 3061 3062 3063 3064 3065 3066 3067 3068 3069 3070 3071 3072 3073 3074 3075 3076 3077 3078 3079 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 | |