1、修改算子运算结果后入库BUG
2、根据设备ID获取设备IP、设备厂商、设备名称 信息补全标准化表 3、完善告警表字段内容:syslog_normal_alarm: http_url ->alarm: victim_web_url
This commit is contained in:
+17
-3
@@ -13,6 +13,7 @@ import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import com.common.service.DeviceReceiveLogService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import com.common.service.NormalizeRuleHitTimeService;
|
||||
@Slf4j
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
@@ -26,18 +27,23 @@ public class ETLOrchestrator {
|
||||
|
||||
@Autowired
|
||||
private DeviceReceiveLogService deviceReceiveLogService;
|
||||
|
||||
@Autowired
|
||||
|
||||
private NormalizeRuleHitTimeService normalizeRuleHitTimeService;
|
||||
/**
|
||||
* 定时任务 - 从每小时第1分钟开始,5分钟间隔执行
|
||||
*/
|
||||
@Scheduled(cron = "0 1/5 * * * ?")
|
||||
public void scheduledETL() {
|
||||
//log.info("开始定时ETL任务");
|
||||
|
||||
long startTime = System.currentTimeMillis();
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
||||
LocalDateTime[] currentWindow=TimeWindowCalculator.getPrevious5MinuteWindow();
|
||||
String strStartTime= currentWindow[0].format(formatter);
|
||||
String strEndTime= currentWindow[1].format(formatter);
|
||||
log.info("ETL任务开始执行,开始时间:{},结束时间:{}",strStartTime,strEndTime );
|
||||
//泛化标准数据告警降噪任务
|
||||
try {
|
||||
//retryHandler.executeWithRetry(() -> dataExtractor.extractAndProcess24HoursGroupedData());
|
||||
retryHandler.executeWithRetry(() -> dataExtractor.extractAndProcessQueryHoursGroupedData(strStartTime,strEndTime ));
|
||||
@@ -49,6 +55,14 @@ public class ETLOrchestrator {
|
||||
} catch (Exception e) {
|
||||
log.error("定时ETL任务执行失败", e);
|
||||
}
|
||||
|
||||
//泛化规则最新命中时间更新任务
|
||||
try {
|
||||
normalizeRuleHitTimeService.updateRuleHitTimeTask();
|
||||
} catch (Exception e) {
|
||||
log.error("泛化规则最新命中时间更新任务执行失败", e);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -89,8 +103,8 @@ public class ETLOrchestrator {
|
||||
/**
|
||||
* 每天凌晨3点清理2天前的数据
|
||||
*/
|
||||
//@Scheduled(cron = "0 0 3 * * ?")
|
||||
@Scheduled(cron = "0 * * * * ?")
|
||||
@Scheduled(cron = "0 0 3 * * ?")
|
||||
//@Scheduled(cron = "0 * * * * ?")
|
||||
public void cleanupOldLogs() {
|
||||
try {
|
||||
LocalDateTime cutoffTime = LocalDateTime.now().minusDays(2);
|
||||
|
||||
+1
-1
@@ -25,7 +25,7 @@ public class ScheduledTask {
|
||||
/**
|
||||
* 每天1点同步昨天的数据
|
||||
*/
|
||||
//c
|
||||
|
||||
public void syncYesterdayData() {
|
||||
log.info("开始执行昨天数据同步任务");
|
||||
LocalDate yesterday = LocalDate.now().minusDays(1);
|
||||
|
||||
Reference in New Issue
Block a user