This is an automated email from the ASF dual-hosted git repository.
liuhongyu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shenyu.git
The following commit(s) were added to refs/heads/master by this push:
new c94c64c703 fix: When there are multiple indices under the alias
shenyu-access-logging, if we do not specify one of them for writing or specify
multiple, an error will be reported. Therefore, here we directly save to the
index of the current day. (#6203)
c94c64c703 is described below
commit c94c64c703acd2b7b74e4fc5359274b4194ecea6
Author: cuixiaojie <[email protected]>
AuthorDate: Tue Oct 21 18:26:21 2025 +0800
fix: When there are multiple indices under the alias shenyu-access-logging,
if we do not specify one of them for writing or specify multiple, an error will
be reported. Therefore, here we directly save to the index of the current day.
(#6203)
Co-authored-by: aias00 <[email protected]>
---
.../logging/elasticsearch/client/ElasticSearchLogCollectClient.java | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git
a/shenyu-plugin/shenyu-plugin-logging/shenyu-plugin-logging-elasticsearch/src/main/java/org/apache/shenyu/plugin/logging/elasticsearch/client/ElasticSearchLogCollectClient.java
b/shenyu-plugin/shenyu-plugin-logging/shenyu-plugin-logging-elasticsearch/src/main/java/org/apache/shenyu/plugin/logging/elasticsearch/client/ElasticSearchLogCollectClient.java
index 72be9b7ede..97a9ac728a 100644
---
a/shenyu-plugin/shenyu-plugin-logging/shenyu-plugin-logging-elasticsearch/src/main/java/org/apache/shenyu/plugin/logging/elasticsearch/client/ElasticSearchLogCollectClient.java
+++
b/shenyu-plugin/shenyu-plugin-logging/shenyu-plugin-logging-elasticsearch/src/main/java/org/apache/shenyu/plugin/logging/elasticsearch/client/ElasticSearchLogCollectClient.java
@@ -112,14 +112,14 @@ public class ElasticSearchLogCollectClient extends
AbstractLogConsumeClient<Elas
List<BulkOperation> bulkOperations = new ArrayList<>();
logs.forEach(log -> {
try {
- bulkOperations.add(new BulkOperation.Builder().create(d ->
d.document(log).index(indexName)).build());
+ bulkOperations.add(new BulkOperation.Builder().create(d ->
d.document(log).index(actualIndex)).build());
} catch (Exception e) {
LogUtils.error(LOG, "add logs error: ", e);
}
});
// Bulk storage
try {
- client.bulk(e -> e.index(indexName).operations(bulkOperations));
+ client.bulk(e -> e.index(actualIndex).operations(bulkOperations));
} catch (Exception e) {
LogUtils.error(LOG, "elasticsearch store logs error: ", e);
}