DoS 检测事件日志默认VSYS ID 为 1

This commit is contained in:
wanglihui
2022-08-19 10:17:52 +08:00
parent 0a6f36393c
commit 47ddef9bca
3 changed files with 15 additions and 3 deletions

View File

@@ -6,6 +6,7 @@ import java.util.Objects;
public class DosEventLog implements Serializable { public class DosEventLog implements Serializable {
private long log_id; private long log_id;
private int common_vsys_id;
private long start_time; private long start_time;
private long end_time; private long end_time;
private String attack_type; private String attack_type;
@@ -27,6 +28,14 @@ public class DosEventLog implements Serializable {
this.log_id = log_id; 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() { public long getStart_time() {
return start_time; return start_time;
} }
@@ -125,8 +134,9 @@ public class DosEventLog implements Serializable {
@Override @Override
public String toString() { public String toString() {
return "dosEventLog{" + return "DosEventLog{" +
"log_id=" + log_id + "log_id=" + log_id +
", common_vsys_id=" + common_vsys_id +
", start_time=" + start_time + ", start_time=" + start_time +
", end_time=" + end_time + ", end_time=" + end_time +
", attack_type='" + attack_type + '\'' + ", attack_type='" + attack_type + '\'' +
@@ -152,6 +162,7 @@ public class DosEventLog implements Serializable {
} }
DosEventLog that = (DosEventLog) o; DosEventLog that = (DosEventLog) o;
return getLog_id() == that.getLog_id() && return getLog_id() == that.getLog_id() &&
getCommon_vsys_id() == that.getCommon_vsys_id() &&
getStart_time() == that.getStart_time() && getStart_time() == that.getStart_time() &&
getEnd_time() == that.getEnd_time() && getEnd_time() == that.getEnd_time() &&
getSession_rate() == that.getSession_rate() && getSession_rate() == that.getSession_rate() &&
@@ -168,6 +179,6 @@ public class DosEventLog implements Serializable {
@Override @Override
public int hashCode() { 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());
} }
} }

View File

@@ -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) { private DosEventLog getResult(DosSketchLog value, long base, Severity severity, double percent, int type, String tag) {
DosEventLog dosEventLog = new DosEventLog(); DosEventLog dosEventLog = new DosEventLog();
dosEventLog.setLog_id(SnowflakeId.generateId()); dosEventLog.setLog_id(SnowflakeId.generateId());
dosEventLog.setCommon_vsys_id(1);
dosEventLog.setStart_time(value.getSketch_start_time()); dosEventLog.setStart_time(value.getSketch_start_time());
dosEventLog.setEnd_time(value.getSketch_start_time() + value.getSketch_duration()); dosEventLog.setEnd_time(value.getSketch_start_time() + value.getSketch_duration());
dosEventLog.setAttack_type(value.getAttack_type()); dosEventLog.setAttack_type(value.getAttack_type());

View File

@@ -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.input.bootstrap.servers=192.168.44.11:9094,192.168.44.14:9094,192.168.44.15:9094
#读取kafka group id #读取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.input.group.id=dos-detection-job-210813-1
#发送kafka metrics并行度大小 #发送kafka metrics并行度大小