code: private void validateEvent(CloudTrailEvent event) {
          if (event.getEventData().getAccountId() == null) {
              logger.error(String.format("Event %s doesn't have account ID.", event.getEventData()));
          }
  
          // more validation here...
      }
docs: Do simple validation before processing.
  
  @param event to validate