Cloudwatch Metric filter pattern for special characters like /

18 views Asked by At

I am new to AWS and I am trying to create log alerting using AWS metric filters. I have a sample JSON for which I need to create cloudwatch metric filter pattern. The json is below

{
    "log": "{\"id\":\"AMQ1234\"}"
}

I am trying to write the syntax for cloud watch metric filter pattern following the document https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/FilterAndPatternSyntax.html something like below

{$.log.id = "AMQ1234"} - Not working, doesn't fetch any results

{$.log.\"id\" = \"AMQ1234\"} - Not working. Saying an error occurred in creating metric filter.

Have some one tried to capture the special characters like this please? Please suggest.

0

There are 0 answers