private PrincipalKeyCredential getLogSearchCredentials() {
    try {
      Credential credential =
        credentialStoreService.getCredential(cluster.getClusterName(), LOGSEARCH_ADMIN_CREDENTIAL_NAME);
      if ((credential != null)  && (credential instanceof PrincipalKeyCredential)) {
        return (PrincipalKeyCredential)credential;
      }

      if (credential == null) {
        LOG.debug("LogSearch credentials could not be obtained from store.");
      } else {
        LOG.debug("LogSearch credentials were not of the correct type, this is likely an error in configuration, credential type is = {}",
          credential.getClass().getName());
      }
    } catch (AmbariException ambariException) {
      LOG.debug("Error encountered while trying to obtain LogSearch admin credentials.", ambariException);
    }

    return null;
  }
Generates the log file tail URI, using the LogSearch server's
query parameters.

@param baseURI the base URI for this request, typically the URI to the
               Ambari Integration searchEngine component

@param componentName the component name
@param hostName the host name

@return
ambari-server/src/main/java/org/apache/ambari/server/controller/logging/LoggingRequestHelperImpl.java