- Neueste
- Die meisten Stimmen
- Die meisten Kommentare
Hi, from what you describe it sounds like you have created a metric filter before sending any logs to CloudWatch, and when you start sending logs, you fail to see the metric filter detecting your logs.
It sounds as if your metric filter may not be properly defined. It is usually best when you start using Metric Filters for the first time to send a few sample logs first to CloudWatch, and then create the metric filter from the wizard, as you can test your filter from the first step on the wizard on the existing data that you have sent to your log group. That would comfort you and eliminate possible error causes if you can prove from that step that your filter actually picks the logs you expect. Dimensions are optional and only apply to JSON or delimited filter patterns, the option won't be available on plain text filters like the one you seem to be willing to define.
The best would be to work backward from what you need: consider how you want to log messages (do you use JSON, a structure, plain text and what info are you adding, e.g. error message, call stack, pointer to location in the code…) and what metric you are willing to extract (just a count of occurrences or the sum or other stat on one of the logged values), then create a few sample messages with the structure and info you want to log, and work out your filter syntax from there.
Relevanter Inhalt
- AWS OFFICIALAktualisiert vor einem Jahr
- AWS OFFICIALAktualisiert vor 2 Jahren
Is the problem that the metric is not triggering, or that you want the metric to capture the contents of your log?
If the former, can you share the metric filter your re using?