Processing Cloudwatch Logs from Kinesis Streams #1476
-
Hi, |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
Yes! Please open up a feature request. We’d also appreciate if you have a sample event (no sensitive data) ;-)
Thank you!!
…On Wed, 24 Aug 2022 at 20:20, blewinter ***@***.***> wrote:
Hi,
We are pushing cloudwatch logs to a subscription filter, and setting the
subscription filter's target to a kinesis stream. When subsequently
processing those logs using Lambda, we'd like to use the
cloud_watch_logs_event data class, but it seems we're unable to because
the log payloads are not encapsulated with '{awslogs': { 'data': }}`. It
appears that encapsulation only happens when the subscription filters
target is lambda directly. Am I understanding this correctly? Would it be
appropriate to put in a feature request to be able to handle Cloudwatch
Logs that don't have that encapsulation?
—
Reply to this email directly, view it on GitHub
<#1476>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAZPQBEZ3IVBD672TQDKU6TV2ZRWJANCNFSM57QJYMXA>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***
com>
|
Beta Was this translation helpful? Give feedback.
-
Hi all! I saw this conversation and remembered a few months ago I sent logs from Cloudwatch to an OnPrem solution and the best and resilient way was using a Cloudwatch subscription to a Kinesis Stream and consuming this stream on the OnPrem solution. Actually you're right @blewinter, Cloudwatch subscription doesn't wrap the log/stream with
For testing purposes only (this is probably not the best solution), I created in my local environment a new method to return the raw event as a CloudWatchLogsDecodedData class and I could parse the logs using the New property in
Lambda function:
What do you think opening a feature request to implement this as a first contributor? Thank you and I hope this information can help in this discussion. |
Beta Was this translation helpful? Give feedback.
-
Thanks for the input! I've submitted the feature request here: #1488 I'm honestly not sure what the most elegant solution is. @leandrodamascena your solution is definitely nice, but I can see it being confusing that the original |
Beta Was this translation helpful? Give feedback.
Closing discussion as this was released in https://github.com/awslabs/aws-lambda-powertools-python/releases/tag/v2.3.0