I am trying to setup cloudwatch log filter using terrafom using below resource element (The logs are in the default format):
resource "aws_cloudwatch_log_metric_filter" "exception-filter" {
name = "Exception filter"
pattern = "Exception:"
log_group_name = "/ecs/application/log"
metric_transformation {
name = "Exceptions"
namespace = "app-custom"
value = "1"
default_value = "0"
}
}
The terraform apply command fails stating InvalidParameterException: Invalid metric filter pattern.
I tried to escape ":" using \ but doing do also I got an error that the symbol ":" is not a valid escape.
Is there any other way to specify the pattern here?