private Long getClusterResourceID(String clusterName) {
    Long clusterResourceId = null;

    if(!StringUtils.isEmpty(clusterName)) {
      try {
        Cluster cluster = ambariManagementController.getClusters().getCluster(clusterName);

        if(cluster == null) {
          LOG.warn(String.format("No cluster found with the name %s, assuming null resource id", clusterName));
        }
        else {
          clusterResourceId = cluster.getResourceId();
        }

      } catch (AmbariException e) {
        LOG.warn(String.format("An exception occurred looking up the cluster named %s, assuming null resource id: %s",
            clusterName, e.getLocalizedMessage()));
      }
    }
    else {
      LOG.debug("The cluster name is not set, assuming null resource id");
    }

    return clusterResourceId;
  }
Get the relevant cluster's resource ID.

@param clusterName a cluster name
@return a resource ID or <code>null</code> if the cluster is not found
ambari-server/src/main/java/org/apache/ambari/server/controller/logging/LoggingSearchPropertyProvider.java