0

Is there a way to know exactly that a logs belongs to a particular requestId in cloudwatch logs for lambda.

ArslanAnjum
  • 1,674
  • 2
  • 17
  • 31

1 Answers1

0

yes the log data has request Id in it -

....
@requestId 9dbe69e3-21d4-4158-86a4-512be3300208
@timestamp 1577448608126
....

Let me know, if this is what you were looking for?

Saurav Kumar Singh
  • 1,352
  • 7
  • 18
  • I am searching for logs in cloudwatch insights. I searched for all the logs where @duration was greater than 20s. Now with the requestId that I got, I again searched. But this time only 3 logs were present. START, END and REPORT. All other intermittent logs are not shown. What am I missing? – ArslanAnjum Dec 27 '19 at 13:09
  • And it looks like REPORT type logs contain @requestId only. All other logs from lambda, do not contain this field. – ArslanAnjum Dec 27 '19 at 13:12
  • is it in cloudwatch insight? – ArslanAnjum Dec 27 '19 at 14:07
  • with this query "fields @ message, @ requestId" , I am seeing @ requestId only in case of START, END and REPORT logs. Other logs contain @ ingestionTime, @ log, @ logstream and @ message – ArslanAnjum Dec 27 '19 at 14:12
  • What runtime/language is this Lambda function? if you look at regular log messages (not START, END or REPORT), does @message actually contain the request id and it's just not getting indexed by CloudWatch Logs? – jaredcnance Jan 15 '20 at 02:54