Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- db_engine_name = db_instance['DBInstances'][0]['OptionGroupMemberships'][0]['OptionGroupName']
- if "mysql" in db_engine_name:
- logs.put_metric_filter(
- logGroupName=logGroupName,
- filterName=FilterName,
- filterPattern='Access denied',
- metricTransformations=[
- {
- 'metricName': MetricName,
- 'metricNamespace': MetricNamespace,
- 'metricValue': "1",
- 'defaultValue': 0
- },
- ]
- )
- elif "postgre" in db_engine_name:
- logs.put_metric_filter(
- logGroupName=logGroupName,
- filterName=FilterName,
- filterPattern='Authentication Failed',
- metricTransformations=[
- {
- 'metricName': MetricName,
- 'metricNamespace': MetricNamespace,
- 'metricValue': "1",
- 'defaultValue': 0
- },
- ]
- )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement