Skip to content

Commit

Permalink
Merge pull request #183 from CloudExplorer-Dev/pr@v1.1@fix_clean_es_log
Browse files Browse the repository at this point in the history
fix: 定时删除ES日志时间范围错误,导致会删除当天以前所有的日志
  • Loading branch information
ulleo authored May 24, 2023
2 parents d9f55a4 + 22cc0ef commit deb80ff
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ public void deleteEsData(String index, int m, Class<?> clazz) {
//provide.delete(5,"ce-file-system-logs", SystemLog.class);
RangeQuery.Builder rangeQuery = new RangeQuery.Builder();
rangeQuery.field("@timestamp");
rangeQuery.lt(JsonData.of("now-" + m + "m"));
rangeQuery.lt(JsonData.of("now-" + m + "M"));
rangeQuery.format("epoch_millis");
Query query = new Query.Builder().range(rangeQuery.build()).build();
NativeQueryBuilder builder = new NativeQueryBuilder();
Expand Down

0 comments on commit deb80ff

Please # to comment.