Reputation: 49683
I want to fetch the 100 latest log events from CloudWatch using its API (AWS Lambda logs).
I have found 2 solutions:
startFromHead
), but only for a specific stream (which doesn't work with Lambda, I want to read from all streams)How can I fetch the 100 latest events from a whole log group?
Upvotes: 1
Views: 2109
Reputation: 344511
You can use the StartQuery API instead:
fields @timestamp, @message | sort @timestamp desc | limit 100
Upvotes: 2