@Override
    public String perform(String[] args, String data, Map<String, Map<String, String>> replacementsMap) {
      if (data == null) {
        return null;
      }
      if (data.contains("/")) {
        return data.split("/")[0];
      } else if (data.contains("@")) {
        return data.split("@")[0];
      } else {
        return data;
      }
    }
Get the primary part of a Kerberos principal.
The format of a typical Kerberos principal is primary/instance@REALM.
ambari-server/src/main/java/org/apache/ambari/server/state/kerberos/VariableReplacementHelper.java