By using AWS re:Post, you agree to the AWS re:Post Terms of Use

How do I check the size of a log group in Amazon CloudWatch?

2 minute read
0

I want to check the size of a log group in Amazon CloudWatch.

Resolution

Check the volume of log events in uncompressed bytes uploaded to CloudWatch Logs

To check the volume of log events in uncompressed bytes uploaded to CloudWatch Logs, use the IncomingBytes metric for a specific log group.

Complete the following steps:

  1. Open the CloudWatch console.
  2. In the navigation pane, choose All metrics.
  3. For each log group, complete the following tasks:

Choose the log's namespace.

Choose LogsLog group metrics, and then select the individual IncomingBytes metrics.

Choose the Graphed metrics tab. Choose Sum for Statistic, and then choose 30 days for Period.

Choose the Graph options tab, and then choose Number.

At the top right of the graph, choose Custom, and then choose Absolute to set the time range. Select a start and end date that corresponds with the last 30 days.

Note: If you choose Relative instead of the Absolute option, then the graph returns incorrect data.

Check the volume of compressed log events of a log group

Note: If you receive errors when you run AWS Command Line Interface (AWS CLI) commands, then see Troubleshoot AWS CLI errors. Also, make sure that you're using the most recent AWS CLI version.

To check the volume of compressed log events of a log group, use either the CloudWatch console or the describe-log-groups command.

Use the CloudWatch console

  1. Open the Amazon CloudWatch console.
  2. In the navigation pane, choose Log groups.
  3. Choose the log group.
  4. The total size of the compressed log events is indicated under Stored bytes.

Use the AWS CLI

To describe a log group, run the following command:

Note: Replace example-log-group with the name of the required log group.

aws logs describe-log-groups --log-group-name-prefix example-log-group

Example output:

{
"logGroups": [
{
"storedBytes": 0,
"metricFilterCount": 0,
"creationTime": 1433189500783,
"logGroupName": example-log-group,
"retentionInDays": 5,
"arn": "arn:aws:logs:us-west-2:0123456789012:log-group:example-log-group:*"
}
]
}

Related information

Which log group is causing a sudden increase in my CloudWatch Logs bill?

AWS OFFICIAL
AWS OFFICIALUpdated a year ago