@Override
    public void initClient0(@NonNull final ElasticSearchLogCollectConfig.ElasticSearchLogConfig config) {
        RestClientBuilder builder = RestClient
                .builder(new HttpHost(config.getHost(), Integer.parseInt(config.getPort())));

        // authentication and config auth cathe.
        if (StringUtils.isNoneBlank(config.getUsername()) && StringUtils.isNoneBlank(config.getPassword())) {
            final CredentialsProvider credentialsProvider = new BasicCredentialsProvider();
            credentialsProvider.setCredentials(AuthScope.ANY,
                    new UsernamePasswordCredentials(config.getUsername(), config.getPassword()));
            builder.setHttpClientConfigCallback(asyncClientBuilder -> {
                if (Boolean.FALSE.equals(config.getAuthCache())) {
                    asyncClientBuilder.disableAuthCaching();
                }
                return asyncClientBuilder.setDefaultCredentialsProvider(credentialsProvider);
            });
        }

        restClient = builder.build();
        transport = new RestClientTransport(restClient, new JacksonJsonpMapper());
        client = new ElasticsearchClient(transport);
        indexName = StringUtils.isNoneBlank(config.getIndexName()) ? config.getIndexName() : GenericLoggingConstant.INDEX;
        LogUtils.info(LOG, "init ElasticSearchLogCollectClient success");
        
        createOrUpdateIndexAlias(indexName);
    }
init elasticsearch client.

@param config elasticsearch client config
shenyu-plugin/shenyu-plugin-logging/shenyu-plugin-logging-elasticsearch/src/main/java/org/apache/shenyu/plugin/logging/elasticsearch/client/ElasticSearchLogCollectClient.java