amazon-cloudwatch

tailing aws lambda/cloudwatch logs

蹲街弑〆低调 提交于 2019-12-12 08:35:16
问题 Found out how to access lambda logs from another answer Is it possible to tail them? (manually pressing refresh is cumbersome) 回答1: Since you mentioned tail -ing, I'm expecting that you are comfortable with working on the terminal with CLI tools. You can install awslogs locally and use it to tail Cloudwatch. e.g. $ awslogs get /aws/lambda/my-api-lambda ALL --watch --profile production Aside from not needing to refresh anything anymore (that's what tail is for), I also like that you don't have

Amazon CloudWatch is not returning Redshift metrics

痴心易碎 提交于 2019-12-12 03:31:59
问题 Below is my part of Python script to retrieve Redshift's PercentageDiskSpaceUsed metric. I have changed my code from the previous post. When i write script using boto3, its not working. But working when written using boto2. Pasting both the scripts. Please check and correct:- Script using boto2:- from boto.ec2 import cloudwatch from datetime import datetime, timedelta import boto REDSHIFT_REGION = 'ap-south-1' connection = boto.ec2.cloudwatch.connect_to_region(REDSHIFT_REGION) def set_time

Triggering AWS Lambda on arrival of new files in AWS S3

风格不统一 提交于 2019-12-11 18:54:40
问题 I have a Lambda function written in Python, which has the code to run Redshift copy commands for 3 tables from 3 files located in AWS S3. Example: I have table A, B and C. The python code contains: 'copy to redshift A from "s3://bucket/abc/A.csv"' 'copy to redshift B from "s3://bucket/abc/B.csv"' 'copy to redshift C from "s3://bucket/abc/C.csv"' This code is triggered whenever a new file among the three arrives at "s3://bucket/abc/" location in S3. So, it loads all the three tables even if

Configure custom metric of AWS CloudWatch Agent for Windows EC2 Instance [%CPU,%Memory,%DiskSpace]

烈酒焚心 提交于 2019-12-11 18:19:36
问题 I have written a PowerShell script to automate of download,install,configuration and start of AWS CloudWatch Agent on Windows EC2 Instance. Right now I have a task to fetch Metrics of CloudWatch Agent such as %CPU Usage, %Memory Usage & %Disk Space usage of Windows EC2 Instance that would need to define on config.json which we configure using amazon-cloudwatch-agent-config-wizard.exe wizard. Please help me to get %CPU usage, %Memory Usage and %Disk Space usage configure on cloudwatch custom

ECS AWS Cloudwatch logs

混江龙づ霸主 提交于 2019-12-11 17:16:47
问题 I have a task in ECS that runs tomcat. That tomcat has 2 or 3 apps deployed to it. I know its not an ideal situation but this is what we've got. Log4j is used and logs for apps goto different log files under logs folder of tomcat. Is there a way I can have those different log files from my docker container to CloudWatch under different streams? I know if I write logs to stdout using log4j appender I can have them in cloudwatch easily but then they will not be separate, it'll be log from all

Sending messages to SNS from CloudWatch via regex?

拥有回忆 提交于 2019-12-11 16:48:33
问题 Is it possible to configure AWS CloudWatch with a filter/monitor that "listens" or watches for a particular type of log message (ideally with granular or regex-like control where I can tell CloudWatch to look for a particular pattern in the log message) so that it forwards the log message off to a particular SNS endpoint? Meaning: My app publishes log messages to CloudWatch CloudWatch is configured with this filter/monitor to listen for log messages matching a particular regex/pattern Any

Getting SerializationException while trying to PutLogEvents on cloudwatch using golang

故事扮演 提交于 2019-12-11 16:40:04
问题 I am trying to achieve following using my program: Create log-group on aws cloudwatch Create log-stream under above log-group Put log-events under above log-stream All this using go lang package main import ( "time" "fmt" "github.com/jcxplorer/cwlogger" "github.com/aws/aws-sdk-go/service/cloudwatchlogs" "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/aws" ) func main() { sess := session.Must(session.NewSessionWithOptions(session.Options{ SharedConfigState: session

API Gateway Cloudwatch advanced logging

爱⌒轻易说出口 提交于 2019-12-11 16:30:45
问题 I am trying to get to the point of billing for API calls made to our services, this includes creating metrics for each API Key usage, but before I even start that I would like to understand a certain aspect of the CloudWatch logs first. In this first image, you'll notice 1.06 million hits recorded on the graph at 6 weeks and 30 day period: My understanding on this is that the 1.06m is the amount of hits that have taken place on this API, the "custom (6w)" is the time period, i.e. over 6 weeks

setting the widget for cloudwatch dashboard. Getting the error “The dashboard body is invalid, there are 1 validation errors”

我的未来我决定 提交于 2019-12-11 15:56:08
问题 I am not able to ref servicename in the widget. Getting the following error with the given code: The dashboard body is invalid, there are 1 validation errors: [ { "dataPath": "/widgets/0/properties/metrics/0", "message": "Should NOT have more than 3 items" } ] (Service: AmazonCloudWatch; Status Code: 400; Error Code: InvalidParameterInput "CloudwatchDashboard": { "Type": "AWS::CloudWatch::Dashboard", "Properties": { "{ \"widgets\": [{ \"type\":\"metric\", \"x\":0, \"y\":0, \"width\":12, \

Modify Existing alarms AWS

﹥>﹥吖頭↗ 提交于 2019-12-11 13:01:45
问题 I want to know how do i read and modify all the alarms ? I am currently facing problem to read the next set of alarms. The first set contains first 50. DescribeAlarmsRequest describeAlarmsRequest = new DescribeAlarmsRequest(); DescribeAlarmsResult alarmsResult = cloudWatch.describeAlarms(describeAlarmsRequest); System.out.println(alarmsResult.getMetricAlarms().size()); System.out.println(alarmsResult.getNextToken()); DescribeAlarmsRequest describeAlarmsRequest1 = new DescribeAlarmsRequest();