修改无法在访问日志中搜索IP的Bug

This commit is contained in:
刘祥超
2021-07-21 22:12:35 +08:00
parent 5124169e28
commit 89ec81f6b1

View File

@@ -236,6 +236,10 @@ func (this *HTTPAccessLogDAO) listAccessLogs(tx *dbs.Tx, lastRequestId string, s
query.Between("remoteAddr", pieces[0], pieces[1])
}
} else {
if regexp.MustCompile(`^ip:.+`).MatchString(keyword) {
keyword = keyword[3:]
}
useOriginKeyword := false
where := "JSON_EXTRACT(content, '$.remoteAddr') LIKE :keyword OR JSON_EXTRACT(content, '$.requestURI') LIKE :keyword OR JSON_EXTRACT(content, '$.host') LIKE :keyword"