增加weblog的create_time的索引

This commit is contained in:
samwaf
2022-10-31 10:42:50 +08:00
parent 975b88174d
commit 5669ef3660
3 changed files with 4 additions and 5 deletions
+1 -1
View File
@@ -12,7 +12,7 @@ type WebLog struct {
COUNTRY string `json:"country"`
PROVINCE string `json:"province"`
CITY string `json:"city"`
CREATE_TIME string `json:"create_time"`
CREATE_TIME string `gorm:"index:idx_weblog_time" json:"create_time"`
CONTENT_LENGTH int64 `json:"content_length"`
COOKIES string `json:"cookies"`
BODY string `json:"body"`
+2 -4
View File
@@ -64,8 +64,6 @@ func main() {
//说明该code有更新
hostRuleChan <- ruleconfig
} else {
zlog.Debug("主机host" + code + " 有最新规则")
}
}
@@ -88,7 +86,7 @@ func main() {
s.StartAsync()
//脱敏处理初始化
global.GWAF_DLP, _ = dlp.NewEngine("my")
global.GWAF_DLP, _ = dlp.NewEngine("wafDlp")
global.GWAF_DLP.ApplyConfigDefault()
for {
select {
@@ -96,7 +94,7 @@ func main() {
//TODO 需要把删除的那部分数据从数据口里面去掉
hostTarget[hostCode[remoteConfig[0].HostCode]].RuleData = remoteConfig
hostTarget[hostCode[remoteConfig[0].HostCode]].Rule.LoadRules(remoteConfig)
zlog.Debug("远程配置", zap.Any("remoteconfig", remoteConfig))
zlog.Debug("远程配置", zap.Any("remoteConfig", remoteConfig))
break
case engineStatus := <-engineChan:
+1
View File
@@ -279,6 +279,7 @@ func modifyResponse() func(*http.Response) error {
oldBytes, err := io.ReadAll(reader)
if err != nil {
zlog.Error("error", err)
return nil
}
// body 追加内容