Hi Everyone,
i was looking last week for 2 days for this and i found a solution to my first use case, but i can't get it working for my second one 
 also its the first time doing something with ruby, so maybe i missing something
its about the AWS SES log events for bounced emails, here is the snipped:
 "bounce": {
      "timestamp": "2020-07-09T10:06:09.000Z",
      "bouncedRecipients": [
        {
          "action": "failed",
          "diagnosticCode": "smtp;550 5.1.10 RESOLVER.ADR.RecipientNotFound; Recipient test@test.com not found by SMTP address lookup",
          "status": "5.1.10",
          "emailAddress": "test@test.com"
        }
      ]
  } 
so i want to get all 4 fields and move it to bounce instead of bounce.bouncedRecipients
my filter right now is not working, i was thinking that i can just output the key + value of each entry of the array, but i only getting "key" and no "value" from this filter:
ruby {
    code => "event.get('[bounce][bouncedRecipients]').each {|hash| event.set('[bounce][' + hash[key] + ']', hash[value]) }"
}
i was also trying to get a hash.each but...ahm yea, maybe i was reading and talking to much about ruby and can't see the obvious solution 
Thanks in advance for reading and hopefully also helping 
Cheers