|
|
@@ -56,7 +56,7 @@ public class NginxLogTest {
|
|
|
String start1 = String.format("%s 00:00:00", startDate);
|
|
|
String end1 = String.format("%s 23:59:59", startDate);
|
|
|
Query dateQuery0 = RangeQuery.of(q -> q.field("timeIso8601")
|
|
|
- .gte(JsonData.of(start1)).lte(JsonData.of(end1)).format("yyyy-MM-dd HH:mm:ss"))._toQuery();
|
|
|
+ .gte(JsonData.of(start1)).lte(JsonData.of(end1)).format("yyyy-MM-dd HH:mm:ss").timeZone("+08:00"))._toQuery();
|
|
|
|
|
|
Query combinedQuery = Query.of(q -> q.matchAll(m -> m));
|
|
|
if (!fieldValue.isBlank()) {
|
|
|
@@ -188,11 +188,8 @@ public class NginxLogTest {
|
|
|
if (nginxLogs.size() > 10_000) {
|
|
|
total += nginxLogs.size();
|
|
|
nginxLogs.forEach(nginxLog -> {
|
|
|
+ // es 的日期时间格式 yyyy-MM-ddTHH:mm:ss+08:00
|
|
|
String timeIso8601 = nginxLog.getTimeIso8601();
|
|
|
- // 日期时间格式 yyyy-MM-ddTHH:mm:ss
|
|
|
- String dateTimeStr = timeIso8601.replace("+08:00", "");
|
|
|
- nginxLog.setTimeIso8601(dateTimeStr);
|
|
|
-
|
|
|
String method = nginxLog.getRequestMethod();
|
|
|
String url = nginxLog.getUrl();
|
|
|
String methodUrl = String.format("%s %s", method, url);
|