amazon-cloudwatchlogs

CloudWatch logs acting weird

回眸只為那壹抹淺笑 提交于 2019-12-03 00:03:53
I have two log files with multi-line log statements. Both of them have same datetime format at the begining of each log statement. The configuration looks like this: state_file = /var/lib/awslogs/agent-state [/opt/logdir/log1.0] datetime_format = %Y-%m-%d %H:%M:%S file = /opt/logdir/log1.0 log_stream_name = /opt/logdir/logs/log1.0 initial_position = start_of_file multi_line_start_pattern = {datetime_format} log_group_name = my.log.group [/opt/logdir/log2-console.log] datetime_format = %Y-%m-%d %H:%M:%S file = /opt/logdir/log2-console.log log_stream_name = /opt/logdir/log2-console.log initial

My AWS Cloudwatch bill is huge. How do I work out which log stream is causing it?

蹲街弑〆低调 提交于 2019-11-30 12:00:27
I got a $1,200 invoice from Amazon for Cloudwatch services last month (specifically for 2 TB of log data ingestion in "AmazonCloudWatch PutLogEvents"), when I was expecting a few tens of dollars. I've logged into the Cloudwatch section of the AWS Console, and can see that one of my log groups used about 2TB of data, but there are thousands of different log streams in that log group, how can I tell which one used that amount of data? On the CloudWatch console, use the IncomingBytes metrics to find the amount of data ingested by each log group for a particular time period in uncompressed bytes

Amazon Cloudwatch Logs Insights with JSON fields

匆匆过客 提交于 2019-11-30 11:42:02
I am trying to use Logs Insights with data containing JSON in one of the fields, and to parse the JSON fields My data looks like the following when I put it in insights with the starter code fields @timestamp, @message | sort @timestamp desc | limit 25 How can I easily extract the path variable in my nested JSON to perform aggregations on it ? By looking at some documentation, I thought @message.path would work but it does not seem so. Has anyone successfully interpreted JSON logs in Insights EDIT : Sample of what my data looks like # @timestamp @message 1 2018-12-19 23:42:52.000 I, [2018-12

Amazon Cloudwatch Logs Insights with JSON fields

旧城冷巷雨未停 提交于 2019-11-29 16:51:13
问题 I am trying to use Logs Insights with data containing JSON in one of the fields, and to parse the JSON fields My data looks like the following when I put it in insights with the starter code fields @timestamp, @message | sort @timestamp desc | limit 25 How can I easily extract the path variable in my nested JSON to perform aggregations on it ? By looking at some documentation, I thought @message.path would work but it does not seem so. Has anyone successfully interpreted JSON logs in Insights

stream logs to elastic using cloudformation template

≯℡__Kan透↙ 提交于 2019-11-28 06:54:03
问题 Cloudtrail default logs can be streamed to elasticsearch domain as shown in this image. How do I achieve this using cloudformation template? 回答1: Update: If you are using aws-cli, take a look at my answer here. Well, after a few hours of exploring and reading a lot of documentation I finally succeeded to create this template. Designer Overview : In order to enable the stream logs to elasticsearch we need to create the following resources: The lambda function will forward the logs from