# How to see the event that triggered a lambda?

**URL:** <https://awshq.com/t/how-to-see-the-event-that-triggered-a-lambda/15820>\
**Category:** Monitoring & DevOps\
**Tags:** lambda\
**Created:** [November 10, 2022, 6:36pm UTC](https://awshq.com/t/how-to-see-the-event-that-triggered-a-lambda/15820 "2022-11-10T18:36:47Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![lsrwlf](https://awshq.com/letter_avatar_proxy/v4/letter/l/90ced4/32.png) [@lsrwlf](https://awshq.com/u/lsrwlf)\
**Post date:** [November 10, 2022, 6:36pm UTC](https://awshq.com/t/how-to-see-the-event-that-triggered-a-lambda/15820/1 "2022-11-10T18:36:47Z")

</div>

Is there a way to view the entire event that was passed to a lambda (say from a DDB Stream) without printing the entire event inside the lambda?

---

<div class="post-metadata">

**Author:** ![redditor13](https://awshq.com/letter_avatar_proxy/v4/letter/r/f6c823/32.png) [@redditor13](https://awshq.com/u/redditor13)\
**Post date:** [November 10, 2022, 6:53pm UTC](https://awshq.com/t/how-to-see-the-event-that-triggered-a-lambda/15820/2 "2022-11-10T18:53:16Z")

</div>

Perhaps creating a CloudTrail trail that captures Lambda events will show the event. Just be mindful of pricing.

---

<div class="post-metadata">

**Author:** ![twratl](https://awshq.com/letter_avatar_proxy/v4/letter/t/5e9695/32.png) [@twratl](https://awshq.com/u/twratl)\
**Post date:** [November 10, 2022, 8:07pm UTC](https://awshq.com/t/how-to-see-the-event-that-triggered-a-lambda/15820/3 "2022-11-10T20:07:00Z")

</div>

Not to my knowledge. Have to print/log it somewhere.

---

<div class="post-metadata">

**Author:** ![madUncleZ](https://awshq.com/letter_avatar_proxy/v4/letter/m/3d9bf3/32.png) [@madUncleZ](https://awshq.com/u/madUncleZ)\
**Post date:** [November 10, 2022, 8:54pm UTC](https://awshq.com/t/how-to-see-the-event-that-triggered-a-lambda/15820/4 "2022-11-10T20:54:51Z")

</div>

We’re using [https://lumigo.io/](https://lumigo.io/) to trace our lambda functions and it’s a great deal in terms of what you’re paying and what you’re getting

---

<div class="post-metadata">

**Author:** ![Flakmaster92](https://awshq.com/letter_avatar_proxy/v4/letter/f/a88e4f/32.png) [@Flakmaster92](https://awshq.com/u/Flakmaster92)\
**Post date:** [November 10, 2022, 11:58pm UTC](https://awshq.com/t/how-to-see-the-event-that-triggered-a-lambda/15820/5 "2022-11-10T23:58:20Z")

</div>

Cloudtrail might show it but our group always defaults to printing it and letting it get captured in CWL

---

<div class="post-metadata">

**Author:** ![made-of-questions](https://awshq.com/letter_avatar_proxy/v4/letter/m/46a35a/32.png) [@made-of-questions](https://awshq.com/u/made-of-questions)\
**Post date:** [November 11, 2022, 12:53am UTC](https://awshq.com/t/how-to-see-the-event-that-triggered-a-lambda/15820/6 "2022-11-11T00:53:53Z")

</div>

If such a mechanism would exist enabled by default, it would be expensive and a security and privacy nightmare. It would mean AWS is keeping a copy of all the data flowing into your system somewhere. That’s a big no no. That event could have passwords, addresses, anything.

That being said, if you know this not to be an issue and want to build something that does it without logging maybe put something in front of the lambda, like an SNS topic that also delivers the event to a database or another lambda.

If you can modify the lambda and just want to separate your concerns, add a lambda layer in front of your original one. This can log or do whatever you want with it.

---

<div class="post-metadata">

**Author:** ![adamavfc](https://awshq.com/letter_avatar_proxy/v4/letter/a/8baadc/32.png) [@adamavfc](https://awshq.com/u/adamavfc)\
**Post date:** [November 11, 2022, 5:39am UTC](https://awshq.com/t/how-to-see-the-event-that-triggered-a-lambda/15820/7 "2022-11-11T05:39:17Z")

</div>

You could just log the event as long as it doesn’t contain sensitive data

---

<div class="post-metadata">

**Author:** ![katatondzsentri](https://awshq.com/letter_avatar_proxy/v4/letter/k/5daacb/32.png) [@katatondzsentri](https://awshq.com/u/katatondzsentri)\
**Post date:** [November 11, 2022, 6:48am UTC](https://awshq.com/t/how-to-see-the-event-that-triggered-a-lambda/15820/8 "2022-11-11T06:48:57Z")

</div>

> [@Flakmaster92](#):
>
> Cloudtrail might show it but our group always defaults to printing it and letting it get captured in CWL

That’s what I do in debug mode.

---

<div class="post-metadata">

**Author:** ![macxima](https://awshq.com/letter_avatar_proxy/v4/letter/m/65b543/32.png) [@macxima](https://awshq.com/u/macxima)\
**Post date:** [November 11, 2022, 10:21am UTC](https://awshq.com/t/how-to-see-the-event-that-triggered-a-lambda/15820/9 "2022-11-11T10:21:38Z")

</div>

There are mainly two ways. For example,

1. track them by creating log history file at your S3 bucket.
2. track them by creating log history table inside your SQLite database as well.
