访问日志策略增加只记录WAF相关访问日志选项

This commit is contained in:
刘祥超
2022-04-22 17:13:59 +08:00
parent fa30015ca5
commit 2aea527dff
11 changed files with 81 additions and 64 deletions

View File

@@ -59,6 +59,10 @@ func (this *ESStorage) Write(accessLogs []*pb.HTTPAccessLog) error {
indexName := this.FormatVariables(this.config.Index)
typeName := this.FormatVariables(this.config.MappingType)
for _, accessLog := range accessLogs {
if this.firewallOnly && accessLog.FirewallPolicyId == 0 {
continue
}
if len(accessLog.RequestId) == 0 {
continue
}