@Nullable
    @Override
    public Message decode(@Nonnull RawMessage rawMessage) {
        try {
            final CloudTrailRecord record = objectMapper.readValue(rawMessage.getPayload(), CloudTrailRecord.class);
            final String source = configuration.getString(Config.CK_OVERRIDE_SOURCE, "aws-cloudtrail");
            final Message message = messageFactory.createMessage(record.getConstructedMessage(), source, DateTime.parse(record.eventTime));

            message.addFields(record.additionalFieldsAsMap());
            message.addField("full_message", record.getFullMessage());
            message.addField(AWS.SOURCE_GROUP_IDENTIFIER, true);

            return message;
        } catch (Exception e) {
            throw new RuntimeException("Could not deserialize CloudTrail record.", e);
        }
    }
@Test
    public void testNoAdditionalEventDataField() {

        final CloudTrailCodec codec = new CloudTrailCodec(Configuration.EMPTY_CONFIGURATION,
                new ObjectMapperProvider().get(), messageFactory);

        final RawMessage rawMessage = new RawMessage(("{\n" +
                "\"eventVersion\": \"1.05\",\n" +
                "\"userIdentity\": {\n" +
                "\"type\": \"IAMUser\",\n" +
                "\"principalId\": \"AIDAJHGSCCCCBBBBAAAA\",\n" +
                "\"arn\": \"arn:aws:iam::1111122221111:user/some.user\",\n" +
                "\"accountId\": \"1111122221111\",\n" +
                "\"userName\": \"some.user\"" +
                "},\n" +
                "\"eventTime\": \"2020-08-19T14:12:28Z\",\n" +
                "\"eventSource\": \"signin.amazonaws.com\",\n" +
                "\"eventName\": \"ConsoleLogin\",\n" +
                "\"awsRegion\": \"us-east-1\",\n" +
                "\"sourceIPAddress\": \"127.0.0.1\",\n" +
                "\"userAgent\": \"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.125 Safari/537.36\",\n" +
                "\"requestParameters\": null,\n" +
                "\"responseElements\": {\n" +
                "\"ConsoleLogin\": \"Success\"\n" +
                "},\n" +
                "\"eventID\": \"df38ed44-32d4-43f6-898f-5a55d260a2bb\",\n" +
                "\"eventType\": \"AwsConsoleSignIn\",\n" +
                "\"recipientAccountId\": \"1111122221111\"\n" +
                "}").getBytes(StandardCharsets.UTF_8));
        Message message = codec.decode(rawMessage);
        assertNull(message.getField("additional_event_data"));
    }