How do I retrieve log data from CloudWatch Logs?
I want to find log data for my Amazon Web Services (AWS) account. What are the best practices for getting log data from Amazon CloudWatch Logs?
"I want to find log data for my Amazon Web Services (AWS) account. What are the best practices for getting log data from Amazon CloudWatch Logs?Short descriptionThere are four methods that are best practices for retrieving log data from CloudWatch Logs. You can use any one of these four, depending upon your use case:Use subscription filters to stream log data to another receiving source in real timeRun a query with CloudWatch Logs InsightsExport log data to Amazon Simple Storage Service (Amazon S3) for batch use casesCall GetLogEvents or FilterLogEvents in the CloudWatch APIResolutionUse subscription filtersTo immediately retrieve log data from CloudWatch Logs in real time, you can use subscription filters. For more information, see Real-time processing of log data with subscriptions and Using CloudWatch Logs subscription filters.Filtering for log events is performed internally, which prevents CloudWatch API throttling. Amazon Kinesis Data Streams automatically retries throttled service API calls.Run a query in CloudWatch Logs InsightsTo quickly search and analyze your log data, run a query in CloudWatch Logs Insights.Export log data to Amazon S3 (batch use cases)To move log data from CloudWatch Logs to Amazon S3 in batch use cases, see Exporting log data to Amazon S3. Log data can take up to twelve hours to become available for export from CloudWatch Logs. For real-time analysis and processing, use subscription filters.Important: An AWS account can have only one export task for log data in the state PENDING, PENDING_CANCEL, or RUNNING.Call GetLogEvents or FilterLogEventsTo find log data manually, use GetLogEvents or FilterLogEvents in the CloudWatch API.Important: This method isn’t scalable due to the transactions per second (TPS) quotas for GetLogEvents and FilterLogEvents. For current quotas, see CloudWatch Logs quotas. If you experience throttling when performing these actions, use subscription filters instead.Related informationWhat is Amazon CloudWatch Logs?Follow"