Questions tagged [aws-cloudwatch-log-insights]

301 questions
3
votes
3 answers

Log group does not exist error when using aws lambda

I'm using aws SQS to trigger a lambda function, after I send message to sqs, when I want to see the cloudwatch log in lambda, I got this error. I'm in the same aws region, any idea what this happened? Log group does not exist The specific log group:…
3
votes
2 answers

Cloudwatch Log Insights syntax for parsing everything before first forward slash

I have a JSON Cloudwatch log as below: {"path": "folder1/folder2/file.txt"} My aim is to parse this log so that I can create a new field parent from the path field such that its value is folder1. I basically need to get everything from the…
3
votes
0 answers

Is there an easy way to add GUI search elements to an AWS cloudwatch dashboard?

I would like to be able to basically add some GUI drop down and search field elements for a Cloudwatch log-insights search to a dashboard to enable non SQL-savvy admins to change filter and sort options easier based on a few pre-chosen selections.…
3
votes
1 answer

Change bar graph x-axis direction in CloudWatch Log Insights

When I graph data in AWS CloudWatch Log insights, bar graphs are ordered Most Recent to Oldest (left to right) while Line Graphs are ordered Oldest to Most recent (left to right) this seems to occur despite setting sort values. Here is an example…
Mike Dalrymple
  • 993
  • 12
  • 23
3
votes
1 answer

AWS Cloudwatch Insights - parse a string as JSON

Sending JSON logs to AWS Cloudwatch - mostly it works great, but once in awhile, I may get a log entry that isn't quite pure JSON (or at least, oddly formatted). Here's an example of a single log entry from a Slack bot: {"message": "Unhandled…
3
votes
2 answers

How to filter out duplicate values from CloudWatch logs?

I have my Android app's logs in CloudWatch. One event am tracking is giving data like this. Using 'count_distinct' it's giving count as 242 and while using 'count', it gives 243. So one duplicate entry is there. I have id field as well. And i guess…
3
votes
2 answers

How to add Query Results Widget to Cloudwatch dashboard using aws-cdk

As the title says, how do I do it? I want to transform my Cloudwatch dashobard (which mostly contains query results widget) into cdk. The aws-cloudwatch library currently only has AlarmWidget, GraphWidget, SingleValueWidget and TextWidget. If…
3
votes
3 answers

Set awslogs log driver on docker container

I want to pass my container logs to AWS Cloud Watch. I'm not able to set the AWS credentials in the Docker Desktop for Mac. Docker Version : Version 19.3.5 Mac OS Version : 10.14.6 I have created ~/.aws/credentials files with the AWS…
3
votes
1 answer

query cloudwatch logs for distinct values using boto3 in python

I have a lambda function that writes metrics to Cloudwatch. While, it writes metrics, It generates some logs in a log-group. INFO:: username: simran+test@abc.com ClinicID: 7667 nodename: MacBook-Pro-2.local INFO:: username: simran+test2@abc.com…
3
votes
1 answer

How to find for aws log groups the corresponding ressource?

due to huge costs in our environment, I have a task to create a lambda to tag all log groups like corresponding resources (the source of these log groups). However, I am facing a challenge to identify the resource arn of log groups. There are many…
3
votes
1 answer

Where can I obtain activity logs of what AWS users have done

I am fairly new to AWS, totally new to IAM. I've set up some user accounts and groups. What I haven't seen yet is a log of user actions. If an EC2 instance gets created, rebooted, stopped, or deleted from the console, I'd like to know which user…
2
votes
0 answers

AWS cloudWatch logs insight, sum the key/value pairs in json

I need some help with the cloud watch insight query that can sum up the key/value pairs in JSON form in logs. fields @timestamp, @message | filter @message like /CTS/ After this, how do I parse the JSON and sum the key/values Logs look like…
2
votes
1 answer

Log messages from Django application not uploaded in AWS CloudWatch

I have added log messages in my Django application and it was successfully logging log messages to the log file. Now, I tried to add log messages to AWS CloudWatch. When I run the application it creates log group in AWS CloudWatch but log stream is…
2
votes
1 answer

How to convert Cloudwatch Dashboard Source Json to CDK

So we've created a dashboard in CloudWatch and we want it initialized by CDK every startup across all our environments. We noticed there's a view/edit source that you can copy paste a json in and we wondered is there a way to convert the View/Edit…
2
votes
1 answer

CloudWatch: Count number of occurrences of a specific string in logfiles

I have logfiles which contain specific spring patterns. These string patterns occur frequently per log event. For example: 108xyz22222 I want to count the occurence of for a specific period of time in CloudWatch. I did…
Tobitor
  • 1,388
  • 1
  • 23
  • 58