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
Handle parsing of CloudTrail logs from S3 #4908
Comments
I'm curious where @lukesteensen thinks this fits in? My inclination is a codec at the source-level that would emit each event individually. |
Yes, this can be written as a function transform that gets embedded in the S3 source |
Attaching an example parser that was used to get logs into the right format https://gist.github.com/zsherman/6732e09e5a0e1f78fea5fb9e59d90655 |
In that example I think what happened for us is that the incoming message was not a 100% properly formatted JSON so the |
As discussed with @jszwedko and @StephenWakely's comment here we decided that having an extra transformation doesn't justify the maintenance burden right now. From the user feedback we figured out that malformed json triggered the request for handling CloudTrail logs, rather than any specific handling in this regard. In practice, the |
@pablosichert @jszwedko Sorry for tagging you guys. Would you help me please to figure out how to parse the Cloudtrail json document with the help of parse_json function? In particular, I don't know the best way to emit messages from
Is there a better way, to handle this within one transform block instead of two? |
That approach should work and is a sensible way to do it. An alternative to combine the two transforms would be to use the |
With the addition of the
aws_s3
source in #4779 , we'd like to make it easy to parse out CloudTrail events from each S3 object.An example object looks like (formatted here for readability, it is just one line in the object in AWS):
The
aws_s3
source will just read this as raw text. This can then be passed through thejson_parser
transform, but I don't know of a good way to emit multiple events (one for each element inRecords
) without using thelua
transform. I believe theremap
transform could aid here as well.The text was updated successfully, but these errors were encountered: