Matthieu Napoli
Matthieu Napoli

Reputation: 49533

How to fetch the latest log events from the CloudWatch API?

I want to fetch the 100 latest log events from CloudWatch using its API (AWS Lambda logs).

I have found 2 solutions:

How can I fetch the 100 latest events from a whole log group?

Upvotes: 1

Views: 2067

Answers (1)

Daniel Vassallo
Daniel Vassallo

Reputation: 344251

You can use the StartQuery API instead:

fields @timestamp, @message | sort @timestamp desc | limit 100

Upvotes: 2

Related Questions