Skip to content

Commit

Permalink
Merge pull request #25 from qzhello/main
Browse files Browse the repository at this point in the history
fix: Add detailed log of index pattern matches
  • Loading branch information
qzhello authored Feb 20, 2024
2 parents 5eff6b6 + 7b9d1a5 commit 963c67d
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ public List<HttpRoute> routes() {
@Override
protected String doHandle(RequestContext context) throws Exception {
List<Map<String, Object>> ckIndices = new ArrayList<>(resolveCkIndices(context));
int ckIndicesSize = ckIndices.size();
String esResponseBody = EsClientUtil.doRequest(context);
JSONObject jsonObject = JSON.parseObject(esResponseBody);
JSONArray indexArray;
Expand All @@ -58,6 +59,8 @@ protected String doHandle(RequestContext context) throws Exception {
ckIndices.add(JSON.parseObject(each.toString(), Map.class));
}
}
int esIndicesSize = ckIndices.size() - ckIndicesSize;
log.info("[resolve][{}] match es indices size: {}, ck indices size: {}", context.getIndex(), esIndicesSize, ckIndicesSize);
context.getHttpResponse().setStatus(HttpStatus.OK.value());
return JSONUtils.serialize(Map.of("indices", ckIndices));
}
Expand Down

0 comments on commit 963c67d

Please sign in to comment.