From 5669ef3660b48e3de01edec6bd02de5f5f265bd0 Mon Sep 17 00:00:00 2001 From: samwaf Date: Mon, 31 Oct 2022 10:42:50 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0weblog=E7=9A=84create=5Ftime?= =?UTF-8?q?=E7=9A=84=E7=B4=A2=E5=BC=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- innerbean/web_log.go | 2 +- main.go | 6 ++---- wafengine.go | 1 + 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/innerbean/web_log.go b/innerbean/web_log.go index 1b9839f..7a4c98c 100644 --- a/innerbean/web_log.go +++ b/innerbean/web_log.go @@ -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"` diff --git a/main.go b/main.go index e610b29..6d0e3c2 100644 --- a/main.go +++ b/main.go @@ -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: diff --git a/wafengine.go b/wafengine.go index ddf8771..56d7657 100644 --- a/wafengine.go +++ b/wafengine.go @@ -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 追加内容