mirror of
https://github.com/TeaOSLab/EdgeAPI.git
synced 2025-11-06 10:00:24 +08:00
优化WAF日志查询速度
This commit is contained in:
@@ -255,6 +255,7 @@ func (this *HTTPAccessLogDAO) listAccessLogs(tx *dbs.Tx, lastRequestId string, s
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
query.Attr("remoteAddr", ip)
|
query.Attr("remoteAddr", ip)
|
||||||
|
query.UseIndex("remoteAddr")
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
query.Where("JSON_EXTRACT(content, '$.remoteAddr')=:ip1").
|
query.Where("JSON_EXTRACT(content, '$.remoteAddr')=:ip1").
|
||||||
@@ -270,6 +271,7 @@ func (this *HTTPAccessLogDAO) listAccessLogs(tx *dbs.Tx, lastRequestId string, s
|
|||||||
Param("host2", domain)
|
Param("host2", domain)
|
||||||
} else {
|
} else {
|
||||||
query.Attr("domain", domain)
|
query.Attr("domain", domain)
|
||||||
|
query.UseIndex("domain")
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
query.Where("JSON_EXTRACT(content, '$.host')=:host1").
|
query.Where("JSON_EXTRACT(content, '$.host')=:host1").
|
||||||
|
|||||||
Reference in New Issue
Block a user