For retrieving log data from CloudWatch Logs:
1. In real time, use the subscription filters for streaming log data to another receiving source end.
2. Consisting of CloudWatch Logs Insights run a query.
3. For batch use cases try exporting log data to Amazon S3.
4. In the cloudwatch API, call GetLogEvents or FilterLogEvents.
For more information, check out this AWS Tutorial.