Questions tagged [amazon-cloudwatchlogs]

Amazon CloudWatch Logs allows aggregation and management of log events sent to it by AWS or custom services. Use this tag when asking about log groups, log streams, and metric filters. Use amazon-cloudwatch instead when asking only about CW metrics or CW alarms.

Amazon CloudWatch Logs allows aggregation and management of log events sent to it by AWS or custom services.

Usage Guidance

  • Use this tag when asking about log groups, log streams, metric filters, etc.
  • Do not use this tag when asking only about CW metrics or CW alarms; use instead.

Resources

862 questions
8
votes
3 answers

How to submit the simple log with AWS CloudWatch Logs from frontend?

After about 1 hour of searching, I didn't find anything about 'how to submit a simple log to AWS CloudWatch Logs' from the frontend side. Almost all examples are for Node.js, but I need to submit the errors from the frontend, not form backend. I…
8
votes
1 answer

Delete custom metric and custom namespaces from cloudwatch

Hi is there any way of getting custom metrics defined on cloudwatch log group be deleted along with its namespace. This is quite weird that we can create a custom metric/namespace using API/Console but cannot delete it either using API or Console…
8
votes
2 answers

Using regular expression filter as aws cloudwatch logs metric filter

For logs sent to AWS cloudwatch-logs, I want to create metric filter separating a numeric field from the log matching pattern. So as per documentation there is [w1=word_pattern1||word_pattern2, w2, ...] like expression to get fields (based on space…
v_sukt
  • 1,384
  • 1
  • 10
  • 21
8
votes
3 answers

How to setup Cloudwatch log for a Lambda created in Cloudformation

After creating a Lambda function in Cloudformation, I would like to be able to setup the Cloudwatch Logs expiration in the same Cloudformation script. eg: MyLambdaRole: Type: AWS::Iam::Role ... Properties: ... Policies: …
Efren
  • 4,003
  • 4
  • 33
  • 75
7
votes
1 answer

How to configure AWS cloudWatchAgent to collect logs recursively from a folder on an EC2 instance?

I have a logs directory on a EC2 instance and cloud watch agent running over there. In the CloudWatch agent configuration file I have given log file details as below "logs": { "logs_collected": { "files": { "collect_list": [ …
7
votes
1 answer

Extract numeric value from string in Cloudwatch to use in metrics (e.g. "64MB")

Is it possible to create a metric that extracts a numeric value from a string in Cloudwatch logs so I can graph / alarm it? For example, the log may be: 20190827 1234 class: File size: 64MB I realize I can capture the space delimited fields by using…
7
votes
3 answers

CloudWatchLogs line length limit

I was wondering if CLoudWatchLogs has a limit on the length of 1 line of logging. I checked the CloudWatchLogs Limit documentation page, but they do not specify anything regarding line length limit. They do mention the Event size limit (256 KB) ,…
7
votes
0 answers

AWS Cloudwatch Logs timestamp parsing with milliseconds

I have a hive-server2 log that's formatting its output with timestamps like: 2017-09-19T18:04:39,717 ERROR [words. But the datetime_format spec doesn't list any support for milliseconds. There is only zero padded microseconds %f -> 000000 ...…
dlamblin
  • 43,965
  • 20
  • 101
  • 140
7
votes
3 answers

AWS Cloud Watch: Metric Filter Value Extraction

I have cloud-init.log logs being sent to CloudWatch and I want to create a metric filter to extract the reported time it takes Cloud Init to run. A sample log entry looks like: Jun 24 12:06:51 ip-x-x-x-x [CLOUDINIT] util.py[DEBUG]: cloud-init mode…
6
votes
1 answer

CloudWatch Logs Insights isn't finding data that exists in logstream

I am running fluent-bit as a sidecar on my EKS cluster for an application to tail application log files and write events to CloudWatch Logs. Through CloudWatch Logs Insights, I then set up some queries and dashboards to analyze those logs. This all…
6
votes
1 answer

Does Cloudwatch deletes old log stream when Log Retention setting is changed?

I have very huge log groups (770GB). I added retention of 120 days to all log groups of my account. My question is, does older logs than 120 days will be deleted? Or I have to wait 120 days?
6
votes
3 answers

How to get an alarm when there are no logs for a time period in AWS Cloudwatch?

I have a Java application that runs in AWS Elastic Container Service. Application polls a queue periodically. Sometimes there is no response from the queue and the application hanging forever. I have enclosed the methods with try-catch blocks with…
6
votes
0 answers

Multi faceted time series visualisation in CloudWatch Log Insights

I'm trying to create a multi-faceted time series graph in CloudWatch Log Insights. I can create a multi-faceted query which is not a time series, and I can create an unfaceted time series query, but I can't seem to do both. For example: I can do a…
6
votes
4 answers

Why i am getting this {"message": "Internal server error" } from Postman

I am new to AWS, I am getting {"message": "Internal server error"} while running the Lambda function with API Gateway in Postman. I have checked the CloudWatchLogs, there is no error showing in the logs. But Postman returning {"message": "Internal…
6
votes
1 answer

Removing specific log events from CloudWatchLogs

I looked through the documentation of CloudWatch Logs, but I could not find any method to manually remove partial data from a log stream. The only way to remove data is to: Remove the log stream, but that will remove all data (not just the data we…