Questions tagged [amazon-cloudwatch]

Amazon CloudWatch provides monitoring for AWS cloud resources and the applications customers run on AWS. Use this tag when asking about CW features such as metrics or alarms. Use amazon-cloudwatchlogs instead when asking about log groups, log streams, and metric filters.

From the web site:

Developers and system administrators can use it to collect and track metrics, gain insight, and react immediately to keep their applications and businesses running smoothly. Amazon CloudWatch monitors AWS resources such as Amazon EC2 and Amazon RDS DB instances, and can also monitor custom metrics generated by a customer’s applications and services.

Usage Guidance

  • Use this tag when asking about CW metrics or CW alarms, the CW API, etc.
  • Do not use this tag when asking only about log groups, log streams, metric filters, etc; use instead.
  • Use both if asking about both (for example, if asking about a CW Logs metric filter that aggregates in a CW custom metric that triggers a CW alarm)

Resources

4155 questions
32
votes
3 answers

Trigger AWS CloudWatch Event Manually

I have a event in CloudWatch, which is triggered once a day. Is there a way to trigger the event manually (for testing purposes)? ...I realize I can increase the frequency of the event's triggering schedule.
Adam
  • 3,891
  • 3
  • 19
  • 42
32
votes
2 answers

Matching array entries in AWS Cloudwatch log metrics filter

I have JSON strings upload to AWS Cloudwatch logs and am now trying to write a filter that generates metrics from those logs. Suppose I have JSON like the following: {"test_results": [{"result": "success", "name": "foo", "nr_failed": 0}, {"result":…
Steve Leibman
  • 621
  • 7
  • 7
30
votes
13 answers

delete all log streams of a log group using aws cli

In order to delete a log stream from a log group using the CLI command , individual log stream names are required . Is there a way to delete all log streams belonging to a log group using a single command?
akhila
  • 720
  • 2
  • 7
  • 17
30
votes
5 answers

How do I filter and extract raw log event data from Amazon Cloudwatch

Is there any way to 1) filter and 2) retrieve the raw log data out of Cloudwatch via the API or from the CLI? I need to extract a subset of log events from Cloudwatch for analysis. I don't need to create a metric or anything like that. This is for…
Zach
  • 805
  • 1
  • 9
  • 16
30
votes
4 answers

How can I be alerted when an EBS instance is running out of space?

I'm running a wordpress off of AWS, and I can't figure out how to monitor if the volume is running out of capacity. There are many options for monitoring other things, but I just want to know when we run low on space.
29
votes
3 answers

AWS Cloudwatch Filter and Pattern Syntax

I'm following the instructions here https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/FilterAndPatternSyntax.html but it's not working as i'm expecting it to. I currently have the following cloudwatch log subscription filter pattern: ?…
26
votes
6 answers

aws logs: The specified log group does not exist

I'm trying to grab logs from Cloudwatch with this CLI usage: cat cli-get-log-events.json { "logGroupName": "/aws/lambda/my-group", "logStreamName": "2019/03/30/[$LATEST]dec1626296d84819be42f2ef615f292e", "startTime": 1553977650000,…
cyrf
  • 5,127
  • 6
  • 25
  • 42
26
votes
4 answers

Auto Scale Fargate Service Based On SQS ApproximateNumberOfMessagesVisible

I would like to scale out my aws fargate containers based on the size of the SQS queue. It appears that I can only scale based on the container's CPU or Memory usage. Is there a way to create a policy that would scale out and in based on queue size?…
26
votes
5 answers

AWS Elastic Beanstalk: Add custom logs to CloudWatch?

How to add custom logs to CloudWatch? Defaults logs are sent but how to add a custom one? I already added a file like this: (in .ebextensions) files: "/opt/elasticbeanstalk/tasks/bundlelogs.d/applogs.conf" : mode: "000755" owner: root …
26
votes
2 answers

Search AWS CloudWatch Logs with special character in JSON property name

We use AWS CloudWatch Logs to debug our services running on AWS, and a number of the property names in our logs use colons as delimiters, but we can't figure out how to search using these property names. Here's an example of a log: { "Counts": { …
25
votes
1 answer

How to run a group by in AWS Cloud Watch Logs Insights

I have CWL Entries as below. Showing entries in SQL Type for clarity Name City 1 Chicago 2 Wuhan 3 Chicago 4 Wuhan 5 Los Angeles Now I want to get below output City Count Chicago 2 Wuhan 2 Los Angeles …
24
votes
6 answers

How to parse mixed text and JSON log entries in AWS CloudWatch for Log Metric Filter

I am trying to parse log entries which are a mix of text and JSON. The first line is text representation and the next lines are JSON payload of the event. One of the possible examples are: 2016-07-24T21:08:07.888Z [INFO] Command completed…
Mike Chaliy
  • 25,801
  • 18
  • 67
  • 105
23
votes
3 answers

What is in the JSON payload Cloudwatch sends to SNS? How can I read that data?

I'm trying to parse data with Lambda when an alarm is triggered in Cloudwatch. I am currently using SNS to trigger the lambda; however, I want to know what data is being sent to that Lambda so that I can parse it correctly. How can I read the JSON…
23
votes
6 answers

Amazon CloudWatch: How to find ARN of CloudWatch Log group

I configure Custom Access Logging for Amazon API Gateway and I need to specify CloudWatch Group name, but when I put these just name of log group in format like "API-Gateway-Execution-Logs_3j5w5m7kv9/stage-name" I get such error: Invalid ARN…
Hleb
  • 7,037
  • 12
  • 58
  • 117
23
votes
2 answers

Amazon Web Service CloudWatch custom metrics with dimensions

I'm trying to push data into a custom metric on AWS CloudWatch but wanted to find out more about the Dimensions and how these are used? I've already read the AWS documentation but it doesn't really explain what they are used for and how it affects…
millie
  • 2,642
  • 10
  • 39
  • 58