diff --git a/src/main/java/com/nis/domain/restful/DkBehaviorLog.java b/src/main/java/com/nis/domain/restful/DkBehaviorLog.java index 1ae9d07..5322c01 100644 --- a/src/main/java/com/nis/domain/restful/DkBehaviorLog.java +++ b/src/main/java/com/nis/domain/restful/DkBehaviorLog.java @@ -16,43 +16,74 @@ public class DkBehaviorLog extends LogEntity { private static final long serialVersionUID = -589390375816690510L; @ApiModelProperty(value = "协议标签", required = true) protected Integer appLabel; - @ApiModelProperty(value = "c2s包数", required = true) - protected String c2sPktNum; - @ApiModelProperty(value = "s2c包数", required = true) - protected String s2cPktNum; - @ApiModelProperty(value = "c2s字节数", required = true) - protected String c2sByteNum; - @ApiModelProperty(value = "s2c字节数", required = true) - protected String s2cByteNum; + @ApiModelProperty(value = "发送c2s包数", required = true) + protected String c2sSendPktNum; + @ApiModelProperty(value = "发送s2c包数", required = true) + protected String s2cSendPktNum; + @ApiModelProperty(value = "发送c2s字节数", required = true) + protected String c2sSendByteNum; + @ApiModelProperty(value = "发送s2c字节数", required = true) + protected String s2cSendByteNum; + @ApiModelProperty(value = "接收c2s包数", required = true) + protected String c2sRecvSendPktNum; + @ApiModelProperty(value = "接收s2c包数", required = true) + protected String s2cRecvSendPktNum; + @ApiModelProperty(value = "接收c2s字节数", required = true) + protected String c2sRecvByteNum; + @ApiModelProperty(value = "接收s2c字节数", required = true) + protected String s2cRecvByteNum; public Integer getAppLabel() { return appLabel; } public void setAppLabel(Integer appLabel) { this.appLabel = appLabel; } - public String getC2sPktNum() { - return c2sPktNum; + public String getC2sSendPktNum() { + return c2sSendPktNum; } - public void setC2sPktNum(String c2sPktNum) { - this.c2sPktNum = c2sPktNum; + public void setC2sSendPktNum(String c2sSendPktNum) { + this.c2sSendPktNum = c2sSendPktNum; } - public String getS2cPktNum() { - return s2cPktNum; + public String getS2cSendPktNum() { + return s2cSendPktNum; } - public void setS2cPktNum(String s2cPktNum) { - this.s2cPktNum = s2cPktNum; + public void setS2cSendPktNum(String s2cSendPktNum) { + this.s2cSendPktNum = s2cSendPktNum; } - public String getC2sByteNum() { - return c2sByteNum; + public String getC2sSendByteNum() { + return c2sSendByteNum; } - public void setC2sByteNum(String c2sByteNum) { - this.c2sByteNum = c2sByteNum; + public void setC2sSendByteNum(String c2sSendByteNum) { + this.c2sSendByteNum = c2sSendByteNum; } - public String getS2cByteNum() { - return s2cByteNum; + public String getS2cSendByteNum() { + return s2cSendByteNum; } - public void setS2cByteNum(String s2cByteNum) { - this.s2cByteNum = s2cByteNum; + public void setS2cSendByteNum(String s2cSendByteNum) { + this.s2cSendByteNum = s2cSendByteNum; + } + public String getC2sRecvSendPktNum() { + return c2sRecvSendPktNum; + } + public void setC2sRecvSendPktNum(String c2sRecvSendPktNum) { + this.c2sRecvSendPktNum = c2sRecvSendPktNum; + } + public String getS2cRecvSendPktNum() { + return s2cRecvSendPktNum; + } + public void setS2cRecvSendPktNum(String s2cRecvSendPktNum) { + this.s2cRecvSendPktNum = s2cRecvSendPktNum; + } + public String getC2sRecvByteNum() { + return c2sRecvByteNum; + } + public void setC2sRecvByteNum(String c2sRecvByteNum) { + this.c2sRecvByteNum = c2sRecvByteNum; + } + public String getS2cRecvByteNum() { + return s2cRecvByteNum; + } + public void setS2cRecvByteNum(String s2cRecvByteNum) { + this.s2cRecvByteNum = s2cRecvByteNum; } - } diff --git a/src/main/java/com/nis/domain/restful/MmAvIpLog.java b/src/main/java/com/nis/domain/restful/MmAvIpLog.java new file mode 100644 index 0000000..f719336 --- /dev/null +++ b/src/main/java/com/nis/domain/restful/MmAvIpLog.java @@ -0,0 +1,72 @@ +package com.nis.domain.restful; + +import com.nis.domain.LogEntity; +import com.wordnik.swagger.annotations.ApiModelProperty; + +/** + * @ClassName:MmAvIpLog + * @Description:TODO(这里用一句话描述这个类的作用) + * @author (zdx) + * @date 2018年7月16日 下午2:54:23 + * @version V1.0 + */ +public class MmAvIpLog extends LogEntity { + + private static final long serialVersionUID = -6177790560553329386L; + @ApiModelProperty(value="节目ID", required=true) + protected String pid; + @ApiModelProperty(value="节目访问地址", required=true) + protected String url; + @ApiModelProperty(value="封堵现场片段路径", required=true) + protected String logUri; + @ApiModelProperty(value="入口页面", required=true) + protected String refer; + @ApiModelProperty(value="有害级别", required=true) + protected Integer level; + @ApiModelProperty(value="封堵类型", required=true) + protected Integer fdType; + @ApiModelProperty(value="协议", required=true) + protected String protocol; + public String getPid() { + return pid; + } + public void setPid(String pid) { + this.pid = pid; + } + public String getUrl() { + return url; + } + public void setUrl(String url) { + this.url = url; + } + public String getLogUri() { + return logUri; + } + public void setLogUri(String logUri) { + this.logUri = logUri; + } + public String getRefer() { + return refer; + } + public void setRefer(String refer) { + this.refer = refer; + } + public Integer getLevel() { + return level; + } + public void setLevel(Integer level) { + this.level = level; + } + public Integer getFdType() { + return fdType; + } + public void setFdType(Integer fdType) { + this.fdType = fdType; + } + public String getProtocol() { + return protocol; + } + public void setProtocol(String protocol) { + this.protocol = protocol; + } +} diff --git a/src/main/java/com/nis/domain/restful/MmAvUrlLog.java b/src/main/java/com/nis/domain/restful/MmAvUrlLog.java new file mode 100644 index 0000000..142b16e --- /dev/null +++ b/src/main/java/com/nis/domain/restful/MmAvUrlLog.java @@ -0,0 +1,72 @@ +package com.nis.domain.restful; + +import com.nis.domain.LogEntity; +import com.wordnik.swagger.annotations.ApiModelProperty; + +/** + * @ClassName:MmAvUrlLog + * @Description:TODO(这里用一句话描述这个类的作用) + * @author (zdx) + * @date 2018年7月16日 下午3:11:42 + * @version V1.0 + */ +public class MmAvUrlLog extends LogEntity { + + private static final long serialVersionUID = 1446933545638550170L; + @ApiModelProperty(value="节目ID", required=true) + protected String pid; + @ApiModelProperty(value="节目访问地址", required=true) + protected String url; + @ApiModelProperty(value="封堵现场片段路径", required=true) + protected String logUri; + @ApiModelProperty(value="入口页面", required=true) + protected String refer; + @ApiModelProperty(value="有害级别", required=true) + protected Integer level; + @ApiModelProperty(value="封堵类型", required=true) + protected Integer fdType; + @ApiModelProperty(value="协议", required=true) + protected String protocol; + public String getPid() { + return pid; + } + public void setPid(String pid) { + this.pid = pid; + } + public String getUrl() { + return url; + } + public void setUrl(String url) { + this.url = url; + } + public String getLogUri() { + return logUri; + } + public void setLogUri(String logUri) { + this.logUri = logUri; + } + public String getRefer() { + return refer; + } + public void setRefer(String refer) { + this.refer = refer; + } + public Integer getLevel() { + return level; + } + public void setLevel(Integer level) { + this.level = level; + } + public Integer getFdType() { + return fdType; + } + public void setFdType(Integer fdType) { + this.fdType = fdType; + } + public String getProtocol() { + return protocol; + } + public void setProtocol(String protocol) { + this.protocol = protocol; + } +} diff --git a/src/main/java/com/nis/domain/restful/MmPicIpLog.java b/src/main/java/com/nis/domain/restful/MmPicIpLog.java new file mode 100644 index 0000000..5f03e02 --- /dev/null +++ b/src/main/java/com/nis/domain/restful/MmPicIpLog.java @@ -0,0 +1,72 @@ +package com.nis.domain.restful; + +import com.nis.domain.LogEntity; +import com.wordnik.swagger.annotations.ApiModelProperty; + +/** + * @ClassName:MmPicIpLog + * @Description:TODO(这里用一句话描述这个类的作用) + * @author (zdx) + * @date 2018年7月16日 下午3:11:20 + * @version V1.0 + */ +public class MmPicIpLog extends LogEntity { + + private static final long serialVersionUID = -3097221323074572913L; + @ApiModelProperty(value="节目ID", required=true) + protected String pid; + @ApiModelProperty(value="节目访问地址", required=true) + protected String url; + @ApiModelProperty(value="封堵现场片段路径", required=true) + protected String logUri; + @ApiModelProperty(value="入口页面", required=true) + protected String refer; + @ApiModelProperty(value="有害级别", required=true) + protected Integer level; + @ApiModelProperty(value="封堵类型", required=true) + protected Integer fdType; + @ApiModelProperty(value="协议", required=true) + protected String protocol; + public String getPid() { + return pid; + } + public void setPid(String pid) { + this.pid = pid; + } + public String getUrl() { + return url; + } + public void setUrl(String url) { + this.url = url; + } + public String getLogUri() { + return logUri; + } + public void setLogUri(String logUri) { + this.logUri = logUri; + } + public String getRefer() { + return refer; + } + public void setRefer(String refer) { + this.refer = refer; + } + public Integer getLevel() { + return level; + } + public void setLevel(Integer level) { + this.level = level; + } + public Integer getFdType() { + return fdType; + } + public void setFdType(Integer fdType) { + this.fdType = fdType; + } + public String getProtocol() { + return protocol; + } + public void setProtocol(String protocol) { + this.protocol = protocol; + } +} diff --git a/src/main/java/com/nis/domain/restful/MmPicUrlLog.java b/src/main/java/com/nis/domain/restful/MmPicUrlLog.java new file mode 100644 index 0000000..2593c98 --- /dev/null +++ b/src/main/java/com/nis/domain/restful/MmPicUrlLog.java @@ -0,0 +1,72 @@ +package com.nis.domain.restful; + +import com.nis.domain.LogEntity; +import com.wordnik.swagger.annotations.ApiModelProperty; + +/** + * @ClassName:MmPicUrlLog + * @Description:TODO(这里用一句话描述这个类的作用) + * @author (zdx) + * @date 2018年7月16日 下午3:11:03 + * @version V1.0 + */ +public class MmPicUrlLog extends LogEntity { + + private static final long serialVersionUID = 4660530265759121390L; + @ApiModelProperty(value="节目ID", required=true) + protected String pid; + @ApiModelProperty(value="节目访问地址", required=true) + protected String url; + @ApiModelProperty(value="封堵现场片段路径", required=true) + protected String logUri; + @ApiModelProperty(value="入口页面", required=true) + protected String refer; + @ApiModelProperty(value="有害级别", required=true) + protected Integer level; + @ApiModelProperty(value="封堵类型", required=true) + protected Integer fdType; + @ApiModelProperty(value="协议", required=true) + protected String protocol; + public String getPid() { + return pid; + } + public void setPid(String pid) { + this.pid = pid; + } + public String getUrl() { + return url; + } + public void setUrl(String url) { + this.url = url; + } + public String getLogUri() { + return logUri; + } + public void setLogUri(String logUri) { + this.logUri = logUri; + } + public String getRefer() { + return refer; + } + public void setRefer(String refer) { + this.refer = refer; + } + public Integer getLevel() { + return level; + } + public void setLevel(Integer level) { + this.level = level; + } + public Integer getFdType() { + return fdType; + } + public void setFdType(Integer fdType) { + this.fdType = fdType; + } + public String getProtocol() { + return protocol; + } + public void setProtocol(String protocol) { + this.protocol = protocol; + } +} diff --git a/src/main/java/com/nis/domain/restful/MmVoipLog.java b/src/main/java/com/nis/domain/restful/MmVoipLog.java new file mode 100644 index 0000000..b116e54 --- /dev/null +++ b/src/main/java/com/nis/domain/restful/MmVoipLog.java @@ -0,0 +1,131 @@ +package com.nis.domain.restful; + +import com.nis.domain.LogEntity; +import com.wordnik.swagger.annotations.ApiModelProperty; + +/** + * @ClassName:MmVoipIpLog + * @Description:TODO(这里用一句话描述这个类的作用) + * @author (zdx) + * @date 2018年7月16日 下午2:57:12 + * @version V1.0 + */ +public class MmVoipLog extends LogEntity { + + private static final long serialVersionUID = -6131067803206270492L; +// @ApiModelProperty(value="VOIP接收时间", required=true) +// protected String recvTime; + @ApiModelProperty(value="VOIP通话时长(秒)", required=true) + protected String duation; + @ApiModelProperty(value="VOIP协议", required=true) + protected String protocol; + @ApiModelProperty(value="主叫VOIP账号", required=true) + protected String callingAccount; + @ApiModelProperty(value="被叫VOIP账号", required=true) + protected String calledAccount; + @ApiModelProperty(value="VOIP主叫电信号码", required=true) + protected String callingNumber; + @ApiModelProperty(value="VOIP被叫电信号码", required=true) + protected String calledNumber; + @ApiModelProperty(value="主叫VOIP语音文件存放服务器IP", required=true) + protected String fromToStoreIp; + @ApiModelProperty(value="主叫VOIP语音文件存放服务器URL", required=true) + protected String fromToStoreUrl; + @ApiModelProperty(value="被叫VOIP语音文件存放服务器IP", required=true) + protected String toFromStoreIp; + @ApiModelProperty(value="被叫VOIP语音文件存放服务器URL", required=true) + protected String toFromStoreUrl; + @ApiModelProperty(value="节目ID", required=true) + protected String pid; + @ApiModelProperty(value="节目访问地址", required=true) + protected String url; + @ApiModelProperty(value="封堵现场片段路径", required=true) + protected String logUri; + @ApiModelProperty(value="封堵类型", required=true) + protected Integer fdType; + + public String getPid() { + return pid; + } + public void setPid(String pid) { + this.pid = pid; + } + public String getUrl() { + return url; + } + public void setUrl(String url) { + this.url = url; + } + public String getLogUri() { + return logUri; + } + public void setLogUri(String logUri) { + this.logUri = logUri; + } + public Integer getFdType() { + return fdType; + } + public void setFdType(Integer fdType) { + this.fdType = fdType; + } + public String getProtocol() { + return protocol; + } + public void setProtocol(String protocol) { + this.protocol = protocol; + } + public String getDuation() { + return duation; + } + public void setDuation(String duation) { + this.duation = duation; + } + public String getCallingAccount() { + return callingAccount; + } + public void setCallingAccount(String callingAccount) { + this.callingAccount = callingAccount; + } + public String getCalledAccount() { + return calledAccount; + } + public void setCalledAccount(String calledAccount) { + this.calledAccount = calledAccount; + } + public String getCallingNumber() { + return callingNumber; + } + public void setCallingNumber(String callingNumber) { + this.callingNumber = callingNumber; + } + public String getCalledNumber() { + return calledNumber; + } + public void setCalledNumber(String calledNumber) { + this.calledNumber = calledNumber; + } + public String getFromToStoreIp() { + return fromToStoreIp; + } + public void setFromToStoreIp(String fromToStoreIp) { + this.fromToStoreIp = fromToStoreIp; + } + public String getFromToStoreUrl() { + return fromToStoreUrl; + } + public void setFromToStoreUrl(String fromToStoreUrl) { + this.fromToStoreUrl = fromToStoreUrl; + } + public String getToFromStoreIp() { + return toFromStoreIp; + } + public void setToFromStoreIp(String toFromStoreIp) { + this.toFromStoreIp = toFromStoreIp; + } + public String getToFromStoreUrl() { + return toFromStoreUrl; + } + public void setToFromStoreUrl(String toFromStoreUrl) { + this.toFromStoreUrl = toFromStoreUrl; + } +} diff --git a/src/main/java/com/nis/restful/RestBusinessCode.java b/src/main/java/com/nis/restful/RestBusinessCode.java index f1b1192..015fc02 100644 --- a/src/main/java/com/nis/restful/RestBusinessCode.java +++ b/src/main/java/com/nis/restful/RestBusinessCode.java @@ -350,6 +350,10 @@ public enum RestBusinessCode { * 配置的service与action关系不存在 */ Service2ActionIsNull(4002010, "配置的service与action关系不存在"), + /** + * 状态更新操作,所有配置的isValid值必须相同 + */ + IsValidNonUniq(4002011, "状态更新操作,所有配置的isValid值必须相同"), /** * 配置分组中同一groupId出现多次 diff --git a/src/main/java/com/nis/util/Constants.java b/src/main/java/com/nis/util/Constants.java index f1b434a..3688777 100644 --- a/src/main/java/com/nis/util/Constants.java +++ b/src/main/java/com/nis/util/Constants.java @@ -191,4 +191,9 @@ public final class Constants { public static final String DIGEST_GEN_TOOL_PATH = Configurations.getStringProperty("digest.gen.tool.path", "maat-redis/digest_gen"); + /** + * 样例文件存放目录 + */ + public static final String MM_SAMPLE_DST_PATH = Configurations.getStringProperty("mmSampleDstPath", "/home/mesasoft/{tableType}/full/{fileName}"); + } diff --git a/src/main/java/com/nis/web/controller/restful/ConfigSourcesController.java b/src/main/java/com/nis/web/controller/restful/ConfigSourcesController.java index f8910cb..199af01 100644 --- a/src/main/java/com/nis/web/controller/restful/ConfigSourcesController.java +++ b/src/main/java/com/nis/web/controller/restful/ConfigSourcesController.java @@ -85,19 +85,20 @@ public class ConfigSourcesController extends BaseRestController { if (null != configSource && null != configSource.getConfigCompileList() && configSource.getConfigCompileList().size() > 0) { int opAction = configSource.getOpAction(); - checkOpAction(thread, System.currentTimeMillis() - start, opAction, 1); // 验证配置编译数据 validateConfigSource(thread, start, configSource); - + Long benginTime = System.currentTimeMillis(); String msg = configSourcesService.saveMaatConfig(thread, start, configSource.getConfigCompileList(), sb); - +// String msg = ""; if ("error".equals(msg)) { Exception exception = ConfigSourcesService.getMsgList().get(0); throw new RestServiceException(thread, System.currentTimeMillis() - start, "存储编译配置时出现异常" + exception.getMessage(),CompileVal.getBusinessCode()); } - + Long endSaveTime = System.currentTimeMillis(); + Long time = (endSaveTime - benginTime) / 1000; + System.out.println("插入数据成功总共需要" + time + "秒"); } else { thread.setExceptionInfo("编译配置数据不能为空"); throw new RestServiceException(thread, System.currentTimeMillis() - start, "编译配置数据不能为空", @@ -108,8 +109,6 @@ public class ConfigSourcesController extends BaseRestController { "编译配置数据插入成功" + sb.toString(), Constants.IS_DEBUG ? configSource : null); } - - @RequestMapping(value = "/cfg/v1/configSources", method = RequestMethod.PUT) @ApiOperation(value = "业务配置状态更新", httpMethod = "PUT", response = Map.class, notes = "对有效的配置(封堵|监测|白名单)进行配置失效") @ApiParam(value = "业务配置数据源", name = "configSource", required = true) diff --git a/src/main/java/com/nis/web/controller/restful/LogController.java b/src/main/java/com/nis/web/controller/restful/LogController.java index 7721c14..9e9d203 100644 --- a/src/main/java/com/nis/web/controller/restful/LogController.java +++ b/src/main/java/com/nis/web/controller/restful/LogController.java @@ -19,6 +19,11 @@ import org.springframework.web.bind.annotation.RestController; import com.nis.domain.LogEntity; import com.nis.domain.Page; import com.nis.domain.restful.DkBehaviorLog; +import com.nis.domain.restful.MmAvIpLog; +import com.nis.domain.restful.MmAvUrlLog; +import com.nis.domain.restful.MmPicIpLog; +import com.nis.domain.restful.MmPicUrlLog; +import com.nis.domain.restful.MmVoipLog; import com.nis.domain.restful.NtcAppLog; import com.nis.domain.restful.NtcAttrTypeReport; import com.nis.domain.restful.NtcDdosLog; @@ -885,15 +890,10 @@ public class LogController extends BaseRestController { logPage.setList(new ArrayList()); } else { List list = tableMapping.get("obj"); -// if (tableMapping.get("obj").size() > page.getPageSize()) { -// list = tableMapping.get("obj").subList(0, page.getPageSize()); -// } else { -// list = tableMapping.get("obj").subList(0, tableMapping.get("obj").size()); -// } if (list.size() > 0) { String jsonString = JsonMapper.toJsonString(list); List List = (java.util.List) JsonMapper.fromJsonList(jsonString, - NtcDdosLog.class); + DkBehaviorLog.class); logPage.setList(List); logPage.setCount(List.size()); @@ -913,6 +913,272 @@ public class LogController extends BaseRestController { return serviceLogResponse(auditLogThread, System.currentTimeMillis() - start, request, "行为识别日志检索成功", logPage, 0); } + @RequestMapping(value = "/mmAvIpLogs", method = RequestMethod.GET) + @ApiOperation(value = "音视频IP日志查询", httpMethod = "GET", notes = "对日志功能“音视频IP日志”提供数据基础查询服务") + public Map mmAvIpLogs(Page page, MmAvIpLog mmAvIpLog, Model model, HttpServletRequest request, + HttpServletResponse response) { + long start = System.currentTimeMillis(); + SaveRequestLogThread auditLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET, + request, null); + + Page logPage = null; + try { + resetTime(mmAvIpLog); + testService.queryConditionCheck(auditLogThread, start, mmAvIpLog, MmAvIpLog.class, page); + logPage = new Page(); + logPage.setPageNo(page.getPageNo()); + logPage.setPageSize(page.getPageSize()); + String orderBy = ""; + if (null != page.getOrderBy() && !page.getOrderBy().equals("")) { + orderBy = Page.getOrderBySql(MmAvIpLog.class.getSimpleName(), page.getOrderBy()); + } else { + orderBy = "found_Time"; + } + ResultSet rs = HiveSqlService.getResultSet(page, mmAvIpLog, + Configurations.getStringProperty(MmAvIpLog.class.getSimpleName() + "HiveTable", "MM_AV_IP_LOG"), + getCol2Col(), orderBy, null); + Map tableMapping = HiveJDBC.tableMapping(page, null, rs, MmAvIpLog.class, "foundTime", + "recvTime"); + if (tableMapping == null) { + logPage.setList(new ArrayList()); + } else { + List list = tableMapping.get("obj"); + if (list.size() > 0) { + String jsonString = JsonMapper.toJsonString(list); + List List = (java.util.List) JsonMapper.fromJsonList(jsonString, + MmAvIpLog.class); + logPage.setList(List); + logPage.setCount(List.size()); + + } else { + logPage.setList(new ArrayList()); + } + } + } catch (Exception e) { + e.printStackTrace(); + auditLogThread.setExceptionInfo(e.getMessage() + " " + e.getCause()); + logger.error(e); + if (!(e instanceof RestServiceException)) { + e = new RestServiceException(auditLogThread, System.currentTimeMillis() - start, "音视频IP日志检索失败"); + } + throw ((RestServiceException) e); + } + return serviceLogResponse(auditLogThread, System.currentTimeMillis() - start, request, "音视频IP日志检索成功", + logPage, 0); + } + @RequestMapping(value = "/mmAvUrlLogs", method = RequestMethod.GET) + @ApiOperation(value = "音视频URL日志查询", httpMethod = "GET", notes = "对日志功能“音视频URL日志”提供数据基础查询服务") + public Map mmAvUrlLogs(Page page, MmAvUrlLog mmAvUrlLog, Model model, HttpServletRequest request, + HttpServletResponse response) { + long start = System.currentTimeMillis(); + SaveRequestLogThread auditLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET, + request, null); + + Page logPage = null; + try { + resetTime(mmAvUrlLog); + testService.queryConditionCheck(auditLogThread, start, mmAvUrlLog, MmAvUrlLog.class, page); + logPage = new Page(); + logPage.setPageNo(page.getPageNo()); + logPage.setPageSize(page.getPageSize()); + String orderBy = ""; + if (null != page.getOrderBy() && !page.getOrderBy().equals("")) { + orderBy = Page.getOrderBySql(MmAvIpLog.class.getSimpleName(), page.getOrderBy()); + } else { + orderBy = "found_Time"; + } + ResultSet rs = HiveSqlService.getResultSet(page, mmAvUrlLog, + Configurations.getStringProperty(MmAvUrlLog.class.getSimpleName() + "HiveTable", "MM_AV_URL_LOG"), + getCol2Col(), orderBy, null); + Map tableMapping = HiveJDBC.tableMapping(page, null, rs, MmAvIpLog.class, "foundTime", + "recvTime"); + if (tableMapping == null) { + logPage.setList(new ArrayList()); + } else { + List list = tableMapping.get("obj"); + if (list.size() > 0) { + String jsonString = JsonMapper.toJsonString(list); + List List = (java.util.List) JsonMapper.fromJsonList(jsonString, + MmAvUrlLog.class); + logPage.setList(List); + logPage.setCount(List.size()); + + } else { + logPage.setList(new ArrayList()); + } + } + } catch (Exception e) { + e.printStackTrace(); + auditLogThread.setExceptionInfo(e.getMessage() + " " + e.getCause()); + logger.error(e); + if (!(e instanceof RestServiceException)) { + e = new RestServiceException(auditLogThread, System.currentTimeMillis() - start, "音视频URL日志检索失败"); + } + throw ((RestServiceException) e); + } + return serviceLogResponse(auditLogThread, System.currentTimeMillis() - start, request, "音视频URL日志检索成功", + logPage, 0); + } + @RequestMapping(value = "/mmPicIpLogs", method = RequestMethod.GET) + @ApiOperation(value = "图片IP日志查询", httpMethod = "GET", notes = "对日志功能“图片IP日志”提供数据基础查询服务") + public Map mmPicIpLogs(Page page, MmPicIpLog mmPicIpLog, Model model, HttpServletRequest request, + HttpServletResponse response) { + long start = System.currentTimeMillis(); + SaveRequestLogThread auditLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET, + request, null); + + Page logPage = null; + try { + resetTime(mmPicIpLog); + testService.queryConditionCheck(auditLogThread, start, mmPicIpLog, MmPicIpLog.class, page); + logPage = new Page(); + logPage.setPageNo(page.getPageNo()); + logPage.setPageSize(page.getPageSize()); + String orderBy = ""; + if (null != page.getOrderBy() && !page.getOrderBy().equals("")) { + orderBy = Page.getOrderBySql(MmPicIpLog.class.getSimpleName(), page.getOrderBy()); + } else { + orderBy = "found_Time"; + } + ResultSet rs = HiveSqlService.getResultSet(page, mmPicIpLog, + Configurations.getStringProperty(MmPicIpLog.class.getSimpleName() + "HiveTable", "MM_PIC_IP_LOG"), + getCol2Col(), orderBy, null); + Map tableMapping = HiveJDBC.tableMapping(page, null, rs, MmPicIpLog.class, "foundTime", + "recvTime"); + if (tableMapping == null) { + logPage.setList(new ArrayList()); + } else { + List list = tableMapping.get("obj"); + if (list.size() > 0) { + String jsonString = JsonMapper.toJsonString(list); + List List = (java.util.List) JsonMapper.fromJsonList(jsonString, + MmPicIpLog.class); + logPage.setList(List); + logPage.setCount(List.size()); + + } else { + logPage.setList(new ArrayList()); + } + } + } catch (Exception e) { + e.printStackTrace(); + auditLogThread.setExceptionInfo(e.getMessage() + " " + e.getCause()); + logger.error(e); + if (!(e instanceof RestServiceException)) { + e = new RestServiceException(auditLogThread, System.currentTimeMillis() - start, "图片IP日志检索失败"); + } + throw ((RestServiceException) e); + } + return serviceLogResponse(auditLogThread, System.currentTimeMillis() - start, request, "图片IP日志检索成功", + logPage, 0); + } + @RequestMapping(value = "/mmPicUrlLogs", method = RequestMethod.GET) + @ApiOperation(value = "图片URL日志查询", httpMethod = "GET", notes = "对日志功能“图片URL日志”提供数据基础查询服务") + public Map mmPicUrlLogs(Page page, MmPicUrlLog mmPicUrlLog, Model model, HttpServletRequest request, + HttpServletResponse response) { + long start = System.currentTimeMillis(); + SaveRequestLogThread auditLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET, + request, null); + + Page logPage = null; + try { + resetTime(mmPicUrlLog); + testService.queryConditionCheck(auditLogThread, start, mmPicUrlLog, MmPicUrlLog.class, page); + logPage = new Page(); + logPage.setPageNo(page.getPageNo()); + logPage.setPageSize(page.getPageSize()); + String orderBy = ""; + if (null != page.getOrderBy() && !page.getOrderBy().equals("")) { + orderBy = Page.getOrderBySql(MmPicUrlLog.class.getSimpleName(), page.getOrderBy()); + } else { + orderBy = "found_Time"; + } + ResultSet rs = HiveSqlService.getResultSet(page, mmPicUrlLog, + Configurations.getStringProperty(MmPicUrlLog.class.getSimpleName() + "HiveTable", "MM_PIC_URL_LOG"), + getCol2Col(), orderBy, null); + Map tableMapping = HiveJDBC.tableMapping(page, null, rs, MmPicUrlLog.class, "foundTime", + "recvTime"); + if (tableMapping == null) { + logPage.setList(new ArrayList()); + } else { + List list = tableMapping.get("obj"); + if (list.size() > 0) { + String jsonString = JsonMapper.toJsonString(list); + List List = (java.util.List) JsonMapper.fromJsonList(jsonString, + MmPicUrlLog.class); + logPage.setList(List); + logPage.setCount(List.size()); + + } else { + logPage.setList(new ArrayList()); + } + } + } catch (Exception e) { + e.printStackTrace(); + auditLogThread.setExceptionInfo(e.getMessage() + " " + e.getCause()); + logger.error(e); + if (!(e instanceof RestServiceException)) { + e = new RestServiceException(auditLogThread, System.currentTimeMillis() - start, "图片URL日志检索失败"); + } + throw ((RestServiceException) e); + } + return serviceLogResponse(auditLogThread, System.currentTimeMillis() - start, request, "图片URL日志检索成功", + logPage, 0); + } + + @RequestMapping(value = "/mmVoipLogs", method = RequestMethod.GET) + @ApiOperation(value = "VOIP日志查询", httpMethod = "GET", notes = "对日志功能“VOIP日志”提供数据基础查询服务") + public Map mmVoipLogs(Page page, MmVoipLog mmVoipLog, Model model, HttpServletRequest request, + HttpServletResponse response) { + long start = System.currentTimeMillis(); + SaveRequestLogThread auditLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET, + request, null); + + Page logPage = null; + try { + resetTime(mmVoipLog); + testService.queryConditionCheck(auditLogThread, start, mmVoipLog, MmAvIpLog.class, page); + logPage = new Page(); + logPage.setPageNo(page.getPageNo()); + logPage.setPageSize(page.getPageSize()); + String orderBy = ""; + if (null != page.getOrderBy() && !page.getOrderBy().equals("")) { + orderBy = Page.getOrderBySql(MmVoipLog.class.getSimpleName(), page.getOrderBy()); + } else { + orderBy = "found_Time"; + } + ResultSet rs = HiveSqlService.getResultSet(page, mmVoipLog, + Configurations.getStringProperty(MmVoipLog.class.getSimpleName() + "HiveTable", "MM_VOIP_LOG"), + getCol2Col(), orderBy, null); + Map tableMapping = HiveJDBC.tableMapping(page, null, rs, MmVoipLog.class, "foundTime", + "recvTime"); + if (tableMapping == null) { + logPage.setList(new ArrayList()); + } else { + List list = tableMapping.get("obj"); + if (list.size() > 0) { + String jsonString = JsonMapper.toJsonString(list); + List List = (java.util.List) JsonMapper.fromJsonList(jsonString, + MmVoipLog.class); + logPage.setList(List); + logPage.setCount(List.size()); + + } else { + logPage.setList(new ArrayList()); + } + } + } catch (Exception e) { + e.printStackTrace(); + auditLogThread.setExceptionInfo(e.getMessage() + " " + e.getCause()); + logger.error(e); + if (!(e instanceof RestServiceException)) { + e = new RestServiceException(auditLogThread, System.currentTimeMillis() - start, "VOIP日志检索失败"); + } + throw ((RestServiceException) e); + } + return serviceLogResponse(auditLogThread, System.currentTimeMillis() - start, request, "VOIP日志检索成功", + logPage, 0); + } @RequestMapping(value = "/ntcPzReport", method = RequestMethod.GET) @ApiOperation(value = "配置日志总量统计", httpMethod = "GET", notes = "配置命中日志数量实时统计报表,对外提供多种数据表现形式,具体可应用于界面配置命中总量业务、配置报表业务等") public Map ntcPzReport(Page page, NtcPzReport ntcPzReport, Model model, HttpServletRequest request, diff --git a/src/main/java/com/nis/web/dao/DfLogSearchDao.xml b/src/main/java/com/nis/web/dao/DfLogSearchDao.xml index b818b7a..514ed6d 100644 --- a/src/main/java/com/nis/web/dao/DfLogSearchDao.xml +++ b/src/main/java/com/nis/web/dao/DfLogSearchDao.xml @@ -373,10 +373,159 @@ - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/java/com/nis/web/service/restful/ConfigJedisServiceimpl.java b/src/main/java/com/nis/web/service/restful/ConfigJedisServiceimpl.java index d03ae35..61e5f08 100644 --- a/src/main/java/com/nis/web/service/restful/ConfigJedisServiceimpl.java +++ b/src/main/java/com/nis/web/service/restful/ConfigJedisServiceimpl.java @@ -24,6 +24,7 @@ import com.nis.util.ServiceAndRDBIndexReal; import redis.clients.jedis.Jedis; import redis.clients.jedis.Transaction; +import redis.clients.jedis.exceptions.JedisConnectionException; @Service() public class ConfigJedisServiceimpl implements ConfigRedisService { @@ -164,8 +165,13 @@ public class ConfigJedisServiceimpl implements ConfigRedisService { } else { transaction.discard(); } + } catch (JedisConnectionException e) { + // transaction.discard(); + logger.error("后台错误:连接redis异常,保存非maat类配置失败,{}", e.getMessage()); + throw new RuntimeException("后台错误:连接redis异常,保存非maat类配置失败", e); } catch (Exception e) { transaction.discard(); + logger.error("后台错误:保存非maat类配置发生了异常,{}", e.getMessage()); throw new RuntimeException("后台错误:保存非maat类配置发生了异常", e); } finally { // 释放连接到连接池 @@ -500,9 +506,12 @@ public class ConfigJedisServiceimpl implements ConfigRedisService { addStatisticsReal(configMap, transaction); transaction.exec(); return true; - }else { + } else { transaction.exec(); } + } catch (JedisConnectionException e) { + // transaction.discard(); + throw new RuntimeException("后台错误:连接redis异常,保存maat类配置失败", e); } catch (Exception e) { transaction.discard(); throw new RuntimeException("后台错误:保存maat类配置发生了异常", e); @@ -735,7 +744,7 @@ public class ConfigJedisServiceimpl implements ConfigRedisService { } @Override - public boolean delUnMaatConfig(Map>> idMap) { + public boolean delUnMaatConfig(Map>> idMap, boolean isInvalid) { if (idMap != null && idMap.size() > 0) { int count = 0; Jedis resource = JedisUtils.getResource(0); @@ -768,7 +777,14 @@ public class ConfigJedisServiceimpl implements ConfigRedisService { for (String keyStr : keySplit) { if (!StringUtils.isEmpty(keyStr) && keyStr.toUpperCase().equals("EFFECTIVE_RULE")) { - keyStr = "OBSOLETE_RULE"; + + if(isInvalid) { + keyStr = "OBSOLETE_RULE"; + }else { + keyStr = "EFFECTIVE_RULE"; + } + + keyBF.append(keyStr.trim()); } else if (!StringUtils.isEmpty(keyStr) && keyStr.trim().startsWith("[")) { @@ -792,15 +808,22 @@ public class ConfigJedisServiceimpl implements ConfigRedisService { keyBF.append(keyStr.trim()); } } + String oldKey = null; maatKey = keyBF.toString(); - String oldKey = maatKey.replace("OBSOLETE_RULE", "EFFECTIVE_RULE"); + if (isInvalid) { + oldKey = maatKey.replace("OBSOLETE_RULE", "EFFECTIVE_RULE"); + } else { + oldKey = maatKey.replace("EFFECTIVE_RULE", "OBSOLETE_RULE"); + } + + if (JedisUtils.exists(oldKey.toString().toUpperCase(), redisDBIndex)) { transaction.rename(oldKey.toString().toUpperCase(), - keyBF.toString().toUpperCase()); + maatKey.toString().toUpperCase()); logger.info("向{}号redis数据库修改了一条配置,修改前key是{},修改后key是{}", redisDBIndex, oldKey.toString().toUpperCase(), - keyBF.toString().toUpperCase()); + maatKey.toString().toUpperCase()); break; } else { throw new RuntimeException("后台错误:" + redisDBIndex @@ -812,10 +835,17 @@ public class ConfigJedisServiceimpl implements ConfigRedisService { if (maatXmlExpr.getKeyExpression().toUpperCase() .equals("MAAT_UPDATE_STATUS")) { if (maatKey != null) { - String zset = maatKey.replace("OBSOLETE_RULE:", "DEL,"); - transaction.zadd("MAAT_UPDATE_STATUS", maatVersion, zset); - logger.info("向{}号redis数据库更新了MAAT_UPDATE_STATUS,内容是{},SCORES是{}", - redisDBIndex, zset.toUpperCase(), maatVersion); + if (isInvalid) { + String zset = maatKey.replace("OBSOLETE_RULE:", "DEL,"); + transaction.zadd("MAAT_UPDATE_STATUS", maatVersion, zset); + logger.info("向{}号redis数据库更新了MAAT_UPDATE_STATUS,内容是{},SCORES是{}", + redisDBIndex, zset.toUpperCase(), maatVersion); + }else { + String zset = maatKey.replace("EFFECTIVE_RULE:", "ADD,"); + transaction.zadd("MAAT_UPDATE_STATUS", maatVersion, zset); + logger.info("向{}号redis数据库更新了MAAT_UPDATE_STATUS,内容是{},SCORES是{}", + redisDBIndex, zset.toUpperCase(), maatVersion); + } } } else if (maatXmlExpr.getKeyExpression().toUpperCase() .equals("MAAT_RULE_TIMER")) { @@ -877,6 +907,9 @@ public class ConfigJedisServiceimpl implements ConfigRedisService { } else { transaction.discard(); } + } catch (JedisConnectionException e) { + // transaction.discard(); + throw new RuntimeException("后台错误:连接redis异常,删除非maat类配置失败", e); } catch (Exception e) { transaction.discard(); throw new RuntimeException("后台错误:删除非maat类配置发生了异常", e); @@ -933,6 +966,9 @@ public class ConfigJedisServiceimpl implements ConfigRedisService { transaction.discard(); } + } catch (JedisConnectionException e) { + // transaction.discard(); + throw new RuntimeException("后台错误:连接redis异常,删除maat类配置失败", e); } catch (Exception e) { transaction.discard(); throw new RuntimeException("后台错误:删除maat类配置发生了异常", e); diff --git a/src/main/java/com/nis/web/service/restful/ConfigRedisService.java b/src/main/java/com/nis/web/service/restful/ConfigRedisService.java index d7e1858..0534e82 100644 --- a/src/main/java/com/nis/web/service/restful/ConfigRedisService.java +++ b/src/main/java/com/nis/web/service/restful/ConfigRedisService.java @@ -44,9 +44,10 @@ public interface ConfigRedisService { /** * 删除非maat类配置,第一个key是redisDBIndex,第二个key是业务类型,value是配置id集合 * @param idMap + * @param isInvalid 是否将配置置为无效 * @return 成功返回true,失败返回false或抛出异常 */ - public boolean delUnMaatConfig(Map>> idMap); + public boolean delUnMaatConfig(Map>> idMap,boolean isInvalid); /** * 删除maat类配置,第一个key是redisDBIndex,第二个key是业务类型,value是配置id集合 diff --git a/src/main/java/com/nis/web/service/restful/ConfigSourcesService.java b/src/main/java/com/nis/web/service/restful/ConfigSourcesService.java index d37e76e..af83fcb 100644 --- a/src/main/java/com/nis/web/service/restful/ConfigSourcesService.java +++ b/src/main/java/com/nis/web/service/restful/ConfigSourcesService.java @@ -3024,6 +3024,21 @@ public class ConfigSourcesService extends BaseService { dstStr.substring(1, dstStr.length() - 1)) .toString(); } + + if("dstFile".equals(commonSourceFieldCfg + .getSrcName())){ + if ("dst_file".equals(commonSourceFieldCfg + .getDstName())) { + String maatTableName = ServiceAndRDBIndexReal + .getUnMaatTableName(Integer.valueOf(srcMap.get("service") + .toString().trim())); + String dstPath = Constants.MM_SAMPLE_DST_PATH.replace("{tableType}", maatTableName.substring(maatTableName.lastIndexOf("_")+1)); + dstPath=dstPath.replace("{fileName}", dstStr.substring(dstStr.lastIndexOf("/")+1)); + }else if ("file_id".equals(commonSourceFieldCfg + .getDstName())) { + dstStr= dstStr.substring(dstStr.indexOf("/group")); + } + } switch (commonSourceFieldCfg.getFieldType()) { case "Number": if (!StringUtil.isNumeric(dstStr)) { @@ -3238,6 +3253,8 @@ public class ConfigSourcesService extends BaseService { } // Map> cfgMap = new HashMap>(); + //所有状态更新的配置isValid的值必须相同 + Map validIdMap = new HashMap(); for (int i = 0; i < jsonObjectList.size(); i++) { JsonObject jsonObj = (JsonObject) jsonObjectList.get(i); Map srcMap = JSONObject.fromObject(JSONObject @@ -3250,6 +3267,7 @@ public class ConfigSourcesService extends BaseService { msg + sb.toString(), CompileVal.getBusinessCode()); } + validIdMap.put(srcMap.get("isValid").toString(), srcMap.get("isValid").toString()); Integer service = Integer.valueOf(srcMap.get("service").toString()); Long cfgId = Long.valueOf(srcMap.get("cfgId").toString()); if (cfgMap.containsKey(service)) { @@ -3261,6 +3279,13 @@ public class ConfigSourcesService extends BaseService { } } + if (validIdMap.size()>1) { + thread.setExceptionInfo(RestBusinessCode.IsValidNonUniq.getErrorReason()); + throw new RestServiceException(thread, + System.currentTimeMillis() - start, + RestBusinessCode.IsValidNonUniq.getErrorReason(), + RestBusinessCode.IsValidNonUniq.getValue()); + } Map>> restMap = new HashMap>>(); Iterator serviceIterator = cfgMap.keySet().iterator(); while (serviceIterator.hasNext()) { @@ -3287,7 +3312,8 @@ public class ConfigSourcesService extends BaseService { } } try { - configRedisService.delUnMaatConfig(restMap); + + configRedisService.delUnMaatConfig(restMap,validIdMap.containsKey("0")?true:false); } catch (Exception e) { // TODO: handle exception logger.error(e.getMessage()); @@ -3328,10 +3354,12 @@ public class ConfigSourcesService extends BaseService { if (!StringUtil.isNumeric(service)) { CompileVal.setBusinessCode(RestBusinessCode.IsValidInWrongRange.getValue()); return RestBusinessCode.IsValidInWrongRange.getErrorReason(); - } else if (!isValid.equals("0")) { - CompileVal.setBusinessCode(RestBusinessCode.IsValidIsF.getValue()); - return RestBusinessCode.IsValidIsF.getErrorReason(); } + //配置取消改为状态更新(停/启用) +// else if (!isValid.equals("0")) { +// CompileVal.setBusinessCode(RestBusinessCode.IsValidIsF.getValue()); +// return RestBusinessCode.IsValidIsF.getErrorReason(); +// } } return "ok"; } diff --git a/src/main/resources/applicationConfig-rule.properties b/src/main/resources/applicationConfig-rule.properties index 1af92fe..ea4cebe 100644 --- a/src/main/resources/applicationConfig-rule.properties +++ b/src/main/resources/applicationConfig-rule.properties @@ -69,7 +69,7 @@ service=1:128;2:128;16:16;17:16;18:16;19:16;20:16;21:16;22:16;23:16;24:16;26:16; #0x82 DNS监测 130=10:NTC_COMPILE;11:NTC_GROUP;12:NTC_UNIVERSAL_IP;13:NTC_UNIVERSAL_PROTO_TYPE;15:NTC_DNS_REGION;18:NTC_IP_RANGE #0x83 SSL监测 -131=10:NTC_COMPILE;11:NTC_GROUP;12:NTC_UNIVERSAL_IP;13:NTC_UNIVERSAL_PROTO_TYPE;14:NTC_SSL_SNI,NTC_SSL_SAN,NTC_SSL_CN;18:NTC_IP_RANGE +131=10:NTC_COMPILE;11:NTC_GROUP;12:NTC_UNIVERSAL_IP;13:NTC_UNIVERSAL_PROTO_TYPE;14:NTC_SSL_SNI,NTC_SSL_SAN,NTC_SSL_CA;18:NTC_IP_RANGE #0x84 MAIL监测 132=10:NTC_COMPILE;11:NTC_GROUP;12:NTC_UNIVERSAL_IP;13:NTC_UNIVERSAL_PROTO_TYPE;15:NTC_MAIL_HDR,NTC_MAIL_BODY;16:NTC_FILE_DIGEST;18:NTC_IP_RANGE #0x85 FTP监测 @@ -236,13 +236,13 @@ unMaatService=3:32;4:96;5:32;25:32;28:32;64:16;65:16;261:16;262:16;263:16;264:16 #0x421 IP限流 1057:6,7; #0x422 域名限流 1058:6,2,7; ##回调类配置 -#0x03 IP地址丢弃 3:2,7; -#0x04 IP地址回流 4:2,7; -#0x1C GRE 丢弃 28:2,7; -#0x19 IPSec丢弃 25:2,7; +#0x03 IP地址丢弃 3:7; +#0x04 IP地址回流 4:7; +#0x1C GRE 丢弃 28:7; +#0x19 IPSec丢弃 25:7; #0x340 IP复用地址池配置(回调)832:2,4,7 ########## -serviceDBIndex=1:2,3,4,6,7;2:2,3,4,6,7;16:2;17:2;18:2;19:2;20:2;21:2;22:2;23:2;24:2;26:2;27:2;30:2;31:2;32:2;33:2,6,7;34:2;128:2;129:2;130:2;131:2;132:2;133:2;134:2;135:2;136:2;137:2;138:2;139:2;140:2;141:2;143:2;144:2;145:2,6,7;256:3;257:3;258:3;259:3;260:3;384:3;385:3;386:3;387:3;388:3;512:4,7;513:4,2,7;528:4;529:4;544:4;545:4;560:4;561:4;768:5;1024:2,6,7;1026:2,6,7;1027:2;1028:2,6,7;1040:2,6,7;1056:2,6,7;1057:6,7;1058:6,2,7;3:2,7;4:2,7;5:2;25:2,7;28:2,7;64:2;65:2;261:8;262:9;263:10;264:11;265:3;266:3;389:3;390:3;391:3;392:3;393:3;394:3;832:2,4,7 +serviceDBIndex=1:2,3,4,6,7;2:2,3,4,6,7;16:2;17:2;18:2;19:2;20:2;21:2;22:2;23:2;24:2;26:2;27:2;30:2;31:2;32:2;33:2,6,7;34:2;128:2;129:2;130:2;131:2;132:2;133:2;134:2;135:2;136:2;137:2;138:2;139:2;140:2;141:2;143:2;144:2;145:2,6,7;256:3;257:3;258:3;259:3;260:3;384:3;385:3;386:3;387:3;388:3;512:4,7;513:4,2,7;528:4;529:4;544:4;545:4;560:4;561:4;768:5;1024:2,6,7;1026:2,6,7;1027:2;1028:2,6,7;1040:2,6,7;1056:2,6,7;1057:6,7;1058:6,2,7;3:7;4:7;5:2;25:7;28:7;64:2;65:2;261:8;262:9;263:10;264:11;265:3;266:3;389:3;390:3;391:3;392:3;393:3;394:3;832:2,4,7 ##maat配置入阀门需要将编译中的部分参数写到域配置中,目前最多包含ACTION,SERVICE,USER_REGION三个属性 diff --git a/src/main/resources/applicationLog-hive.properties b/src/main/resources/applicationLog-hive.properties index 52c3c4b..718d85b 100644 --- a/src/main/resources/applicationLog-hive.properties +++ b/src/main/resources/applicationLog-hive.properties @@ -13,10 +13,11 @@ NtcFtpLogHiveTable=NTC_FTP_LOG NtcAppLogHiveTable=NTC_APP_LOG NtcDdosLogHiveTable=NTC_DDOS_LOG DkBehaviorLogHiveTable=DK_BEHAVIOR_LOG - - - - +MmAvIpLogHiveTable=MM_AV_IP_LOG +MmAvUrlLogHiveTable=MM_AV_URL_LOG +MmPicIpLogHiveTable=MM_PIC_IP_LOG +MmPicUrlLogHiveTable=MM_PIC_URL_LOG +MmVoipIpLogHiveTable=MM_VOIP_LOG diff --git a/src/main/resources/maatXml/applicationConfig-maatRedis.xml b/src/main/resources/maatXml/applicationConfig-maatRedis.xml index f51d84f..d17ed49 100644 --- a/src/main/resources/maatXml/applicationConfig-maatRedis.xml +++ b/src/main/resources/maatXml/applicationConfig-maatRedis.xml @@ -7,10 +7,10 @@ 音频样例监测 389=0:MM_SAMPLE_AUDIO #0x186 视频样例监测 390=0:MM_SAMPLE_VIDEO #0x187 图片样例监测 391=0:MM_SAMPLE_PIC #0x188 VOIP样例监测 392=0:MM_SAMPLE_VOIP --> - + EFFECTIVE_RULE;:;{un_maat_table_name};,;[cfg_id] - [cfg_id];\t;[is_valid];\t;[dst_file];\t;[dst_file_md5];\t;[op_time];&nbsp;[level];\t;[file_id];\n + [cfg_id];\t;[is_valid];\t;[dst_file];\t;[dst_file_md5];\t;[op_time];\t;[service];\t;[action];&nbsp;[level];\t;[file_id];\n @@ -28,29 +28,6 @@ MAAT_VERSION_TIMER - - - - - - EFFECTIVE_RULE;:;{un_maat_table_name};,;[cfg_id] - [cfg_id];\t;[service];\t;[action];\t;[level];\t;[dst_file];\t;[dst_file_md5];\t;[is_valid];\t;[op_time];&nbsp;[file_id];\n - - - 1 - MAAT_VERSION - - - MAAT_UPDATE_STATUS - - - - MAAT_RULE_TIMER - - - MAAT_VERSION_TIMER - - diff --git a/src/main/resources/nis.properties b/src/main/resources/nis.properties index 90b689b..18094d3 100644 --- a/src/main/resources/nis.properties +++ b/src/main/resources/nis.properties @@ -254,4 +254,6 @@ redisStatisticsReal=[COMPILE_ID];\t;[SERVICE];\t;[ACTION];\t;[CONT_TYPE];\t;[ATT redisStatisticsRealDBIndex=14 #maat测试程序输出日志的文件目录 -maatTestLogPath=c:/maat/mmat.log \ No newline at end of file +maatTestLogPath=c:/maat/mmat.log +#样例文件存放目录,{tableType}和{fileName}会替换成具体内容 +mmSampleDstPath=/home/mesasoft/{tableType}/full/{fileName} \ No newline at end of file