支持使用请求ID搜索访问日志

This commit is contained in:
GoEdgeLab
2021-12-02 11:50:16 +08:00
parent 6da9c4cf68
commit 754fedba20

View File

@@ -330,6 +330,11 @@ func (this *HTTPAccessLogDAO) listAccessLogs(tx *dbs.Tx, lastRequestId string, s
query.Param("intKeyword2", types.Int(pieces[1]))
}
if regexp.MustCompile(`^\d{20,}$`).MatchString(keyword) {
where += " OR requestId=:requestId"
query.Param("requestId", keyword)
}
query.Where("("+where+")").
Param("keyword", "%"+keyword+"%")
if useOriginKeyword {