Reputation: 49533
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: 2067
Reputation: 344251
You can use the StartQuery API instead:
fields @timestamp, @message | sort @timestamp desc | limit 100
Upvotes: 2