private String getUsername(Request request) {
    Map<String, Object> first = Iterables.getFirst(request.getBody().getPropertySets(), null);
    if (first != null) {
      return String.valueOf(first.get(UserResourceProvider.USER_USERNAME_PROPERTY_ID));
    }
    return null;
  }
Returns the username from the request
@param request
@return
ambari-server/src/main/java/org/apache/ambari/server/audit/request/eventcreator/UserEventCreator.java