I can presumably get all log events from a CloudWatch logStream using:
const cwl = new AWS.CloudWatchLogs();
cwl.getLogEvents({logGroupName, logStreamName}, (err, results) => {
for (let r of results.events) {
console.log(r.message);
}
});
however, my question is - is there a way to stream the logs instead of reading all of them at once? Seems like for some log streams there could be a million events/records so might be too much data to read all at once?
I looked at the declaration file for cloudwatchlogs.d.ts: https://github.com/aws/aws-sdk-js/blob/master/clients/cloudwatchlogs.d.ts
don't see anything that can stream the logs to a client.