amazon-cloudwatchlogs

Use awslogs with kubernetes 'natively'

若如初见. 提交于 2020-01-24 10:50:53
问题 I came up with a way of configuring k8s to use aws logs without any 3rd party service/application. All you have to do is to add the following lines in your master.yaml file: spec: additionalPolicies: master: | [ { "Effect": "Allow", "Action": ["logs:CreateLogGroup", "logs:CreateLogStream", "logs:PutLogEvents"], "Resource": ["*"] } ] node: | [ { "Effect": "Allow", "Action": ["logs:CreateLogGroup", "logs:CreateLogStream", "logs:PutLogEvents"], "Resource": ["*"] } ] docker: logDriver: awslogs

Use awslogs with kubernetes 'natively'

我的梦境 提交于 2020-01-24 10:50:05
问题 I came up with a way of configuring k8s to use aws logs without any 3rd party service/application. All you have to do is to add the following lines in your master.yaml file: spec: additionalPolicies: master: | [ { "Effect": "Allow", "Action": ["logs:CreateLogGroup", "logs:CreateLogStream", "logs:PutLogEvents"], "Resource": ["*"] } ] node: | [ { "Effect": "Allow", "Action": ["logs:CreateLogGroup", "logs:CreateLogStream", "logs:PutLogEvents"], "Resource": ["*"] } ] docker: logDriver: awslogs

How do I filter AWS Cloud Watch Logs on a hash on the main page?

耗尽温柔 提交于 2020-01-16 09:05:26
问题 How can I go directly to the log 7cf2c033bfec48e8a74c40b08cdxx15f from the main Cloud Watch logs page filter? This is the one that filters out log groups. Here is the message Failed to create resource. See the details in CloudWatch Log Stream: 2019/08/22/[$LATEST]7cf2c033bfec48e8a74c40b08cdxx15f Now I want to use the hash to find the log group and the log stream 回答1: You can do it with Logs Insights. On CloudWatch Console, navigate to Insights on the left panel (just under logs). Click the

Amazon SNS Service Push Notification delivered or not

一曲冷凌霜 提交于 2019-12-25 16:47:39
问题 I am using Aws SNS to send notification, and sending notifications to different topics and is working perfectly. When i publish notification, i got array like object(Aws\Result)#84 (1) { ["data":"Aws\Result":private]=> array(2) { ["MessageId"]=> string(36) "************-7a29-591f-8765-************" ["@metadata"]=> array(4) { ["statusCode"]=> int(200) ["effectiveUri"]=> string(40) "https://sns.ap-southeast-1.amazonaws.com" ["headers"]=> array(4) { ["x-amzn-requestid"]=> string(36) "***********

query cloudwatch logs for distinct values using boto3 in python

痴心易碎 提交于 2019-12-24 18:49:28
问题 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 ClinicID: 7669 nodename: MacBook-Pro-3.local INFO:: username: simran+test@abc.com ClinicID: 7668 nodename: MacBook-Pro-4.local INFO:: username: simran+test3@abc.com ClinicID: 7667 nodename: MacBook-Pro-5.local INFO:: username: simran+test3@abc.com

How do I get AWS credentials in the AWS ECS docker container?

那年仲夏 提交于 2019-12-23 09:10:38
问题 First, I use the server environment: sever: django + nginx + uwsgi cloud: docker + AWS ECS logging: AWS CloudWatch log service + watchtower third party app I am using the watchtower third party app for the AWS CloudWatch log service. So, I need to give AWS credential information to the docker container. When testing locally, docker run -v $ HOME / .aws: /root/.aws --rm -it -p 8080: 80 image_name will connect the local credentials to the volume. But I don't know how to apply it in AWS ECS.

AWS Cloudwatch logs with Docker Container - NoCredentialProviders: no valid providers in chain

无人久伴 提交于 2019-12-22 04:34:13
问题 My docker-compose file: version: '2' services: scraper: build: ./Scraper/ logging: driver: "awslogs" options: awslogs-region: "eu-west-1" awslogs-group: "doctors-logs" awslogs-stream: "scrapers-stream" volumes: - ./Scraper/spiders:/spiders I have added my AWS credentials to my mac using the aws configure command and the credentials are stored correctly in ~/.aws/credentials When I run docker-compose up I get the following error: ERROR: for scraper Cannot start service scraper: Failed to

AWS SNS delivery status

偶尔善良 提交于 2019-12-17 21:17:10
问题 I am new in Aws, I am using Aws SNS to send notification, i am sending notifications to different topic not to endpoint. This is working perfectly. When i publish notification, i got array like object(Aws\Result)#84 (1) { ["data":"Aws\Result":private]=> array(2) { ["MessageId"]=> string(36) "************-7a29-591f-8765-************" ["@metadata"]=> array(4) { ["statusCode"]=> int(200) ["effectiveUri"]=> string(40) "https://sns.ap-southeast-1.amazonaws.com" ["headers"]=> array(4) { ["x-amzn

CloudWatch Log group missing although CloudWatch agent is working

て烟熏妆下的殇ゞ 提交于 2019-12-14 03:34:00
问题 I can't see the Log group defined by Cloud Watch agent on my EC2 instance Also, the default log group /var/log/messages is not visible. I can't see these logs also on root account. I have other log groups configured and visible. I have the following setup: Amazon Linux AMI managed role attached to instance: CloudWatchAgentServerPolicy Agent installed via awslogs - https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/QuickStartEC2Instance.html Agent started successfully No errors in /var

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