@Override
  public Set<Resource> populateResources(Set<Resource> resources, Request request, Predicate predicate) throws SystemException {
    Map<String, Boolean> isLogSearchRunning = new HashMap<>();
    for (Resource resource : resources) {
      // obtain the required identifying properties on the host component resource
      final String componentName = (String)resource.getPropertyValue(PropertyHelper.getPropertyId("HostRoles", "component_name"));
      final String hostName = (String) resource.getPropertyValue(PropertyHelper.getPropertyId("HostRoles", "host_name"));
      final String clusterName = (String) resource.getPropertyValue(PropertyHelper.getPropertyId("HostRoles", "cluster_name"));

      // Test to see if the authenticated user is authorized to view this data... if not, skip it.
      if(!AuthorizationHelper.isAuthorized(ResourceType.CLUSTER, getClusterResourceID(clusterName), REQUIRED_AUTHORIZATIONS)) {
        if(LOG.isDebugEnabled()) {
          LOG.debug("The authenticated user ({}) is not authorized to access LogSearch data for the cluster named {}",
              AuthorizationHelper.getAuthenticatedName(),
              clusterName);
        }
        continue;
      }

      Boolean isLogSearchRunningForSpecifiedCluster = isLogSearchRunning.get(clusterName);
      if (isLogSearchRunningForSpecifiedCluster == null) {
        isLogSearchRunningForSpecifiedCluster = logSearchServerRunning(clusterName);
        isLogSearchRunning.put(clusterName, isLogSearchRunningForSpecifiedCluster);
      }
      if (!isLogSearchRunningForSpecifiedCluster) {
        continue;
      }

      // query the stack definitions to find the correct component name (stack name mapped to LogSearch-defined name)
      final String mappedComponentNameForLogSearch =
        getMappedComponentNameForSearch(clusterName, componentName, ambariManagementController);

      if (mappedComponentNameForLogSearch != null) {
        // send query to obtain logging metadata
        Set<String> logFileNames =
          logSearchDataRetrievalService.getLogFileNames(mappedComponentNameForLogSearch, hostName, clusterName);

        if ((logFileNames != null) && (!logFileNames.isEmpty())) {
          HostComponentLoggingInfo loggingInfo = new HostComponentLoggingInfo();
          loggingInfo.setComponentName(mappedComponentNameForLogSearch);
          List<LogFileDefinitionInfo> listOfFileDefinitions =
            new LinkedList<>();

          for (String fileName : logFileNames) {
            // generate the URIs that can be used by clients to obtain search results/tail log results/etc
            final String searchEngineURI = ambariManagementController.getAmbariServerURI(getFullPathToSearchEngine(clusterName));
            final String logFileTailURI = logSearchDataRetrievalService.getLogFileTailURI(searchEngineURI, mappedComponentNameForLogSearch, hostName, clusterName);
            if (logFileTailURI != null) {
              // all log files are assumed to be service types for now
              listOfFileDefinitions.add(new LogFileDefinitionInfo(fileName, LogFileType.SERVICE, searchEngineURI, logFileTailURI));
            }
          }

          loggingInfo.setListOfLogFileDefinitions(listOfFileDefinitions);

          LOG.debug("Adding logging info for component name = " + componentName + " on host name = " + hostName);
          // add the logging metadata for this host component
          resource.setProperty("logging", loggingInfo);
        } else {
          if (LOG.isDebugEnabled()) {
            String debugMessage =
              String.format("Error occurred while making request to LogSearch service, unable to populate logging properties on this resource, component = %s, host = %s",
                            componentName, hostName);

            Utils.logDebugMessageWithCounter(LOG, errorLogCounterForLogSearchConnectionExceptions,
                                             debugMessage);
          }
        }
      }

    }

    return resources;
  }
The user of authorizations for which a user must have one of in order to access LogSearch data
ambari-server/src/main/java/org/apache/ambari/server/controller/logging/LoggingSearchPropertyProvider.java