diff options
| author | wanglihui <[email protected]> | 2022-08-19 10:17:52 +0800 |
|---|---|---|
| committer | wanglihui <[email protected]> | 2022-08-19 10:17:52 +0800 |
| commit | 47ddef9bca4a4b5ddc55912720166bbbf93fb206 (patch) | |
| tree | 80933632e78737a67ca020b25365552ad05c3c00 | |
| parent | 0a6f36393c5659f54c16514d9ce8ed6ff61e0239 (diff) | |
DoS 检测事件日志默认VSYS ID 为 1tsg-22.09
| -rw-r--r-- | src/main/java/com/zdjizhi/common/DosEventLog.java | 15 | ||||
| -rw-r--r-- | src/main/java/com/zdjizhi/etl/DosDetection.java | 1 | ||||
| -rw-r--r-- | src/main/resources/common.properties | 2 |
3 files changed, 15 insertions, 3 deletions
diff --git a/src/main/java/com/zdjizhi/common/DosEventLog.java b/src/main/java/com/zdjizhi/common/DosEventLog.java index 51590e9..c5ad395 100644 --- a/src/main/java/com/zdjizhi/common/DosEventLog.java +++ b/src/main/java/com/zdjizhi/common/DosEventLog.java @@ -6,6 +6,7 @@ import java.util.Objects; public class DosEventLog implements Serializable { private long log_id; + private int common_vsys_id; private long start_time; private long end_time; private String attack_type; @@ -27,6 +28,14 @@ public class DosEventLog implements Serializable { this.log_id = log_id; } + public int getCommon_vsys_id() { + return common_vsys_id; + } + + public void setCommon_vsys_id(int common_vsys_id) { + this.common_vsys_id = common_vsys_id; + } + public long getStart_time() { return start_time; } @@ -125,8 +134,9 @@ public class DosEventLog implements Serializable { @Override public String toString() { - return "dosEventLog{" + + return "DosEventLog{" + "log_id=" + log_id + + ", common_vsys_id=" + common_vsys_id + ", start_time=" + start_time + ", end_time=" + end_time + ", attack_type='" + attack_type + '\'' + @@ -152,6 +162,7 @@ public class DosEventLog implements Serializable { } DosEventLog that = (DosEventLog) o; return getLog_id() == that.getLog_id() && + getCommon_vsys_id() == that.getCommon_vsys_id() && getStart_time() == that.getStart_time() && getEnd_time() == that.getEnd_time() && getSession_rate() == that.getSession_rate() && @@ -168,6 +179,6 @@ public class DosEventLog implements Serializable { @Override public int hashCode() { - return Objects.hash(getLog_id(), getStart_time(), getEnd_time(), getAttack_type(), getSeverity(), getConditions(), getDestination_ip(), getDestination_country(), getSource_ip_list(), getSource_country_list(), getSession_rate(), getPacket_rate(), getBit_rate()); + return Objects.hash(getLog_id(), getCommon_vsys_id(), getStart_time(), getEnd_time(), getAttack_type(), getSeverity(), getConditions(), getDestination_ip(), getDestination_country(), getSource_ip_list(), getSource_country_list(), getSession_rate(), getPacket_rate(), getBit_rate()); } } diff --git a/src/main/java/com/zdjizhi/etl/DosDetection.java b/src/main/java/com/zdjizhi/etl/DosDetection.java index d1fdd21..8221b81 100644 --- a/src/main/java/com/zdjizhi/etl/DosDetection.java +++ b/src/main/java/com/zdjizhi/etl/DosDetection.java @@ -148,6 +148,7 @@ public class DosDetection extends RichMapFunction<DosSketchLog, DosEventLog> { private DosEventLog getResult(DosSketchLog value, long base, Severity severity, double percent, int type, String tag) { DosEventLog dosEventLog = new DosEventLog(); dosEventLog.setLog_id(SnowflakeId.generateId()); + dosEventLog.setCommon_vsys_id(1); dosEventLog.setStart_time(value.getSketch_start_time()); dosEventLog.setEnd_time(value.getSketch_start_time() + value.getSketch_duration()); dosEventLog.setAttack_type(value.getAttack_type()); diff --git a/src/main/resources/common.properties b/src/main/resources/common.properties index 819af84..7defe8a 100644 --- a/src/main/resources/common.properties +++ b/src/main/resources/common.properties @@ -15,7 +15,7 @@ kafka.input.topic.name=DOS-SKETCH-RECORD kafka.input.bootstrap.servers=192.168.44.11:9094,192.168.44.14:9094,192.168.44.15:9094 #读取kafka group id -kafka.input.group.id=2112080949 +kafka.input.group.id=dos-detection-job-220816-1 #kafka.input.group.id=dos-detection-job-210813-1 #发送kafka metrics并行度大小 |
