Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support messages with non-ascii characters in splunk-cloudwatch-logs-processor #17

Open
cazlo opened this issue Dec 8, 2020 · 1 comment

Comments

@cazlo
Copy link

cazlo commented Dec 8, 2020

What

When handling logs with non-ASCII information, the splunk-cloudwatch-logs-processor lambda blows up

Why

This is because it is trying to read the event string using the ASCII encoding
https://github.com/splunk/splunk-aws-serverless-apps/blob/master/splunk-cloudwatch-logs-processor/index.js#L46

Quick Fix

A quick fix for this is to instead use utf-8 encoding when reading the AWSevent

Reproducing this issue

  1. base64 decode the sample event
  2. add some Chinese characters to one of the messages
  3. base64 encode sample event
  4. run integration test
  5. observe test failure
@cazlo
Copy link
Author

cazlo commented Dec 9, 2020

It looks like we can guarantee messages will be in utf-8. From aws documentation:

Event messages must be UTF-8 encoded

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant