Commit 1681721a authored by qiuqunfeng's avatar qiuqunfeng
Browse files

Update AttackListener filter in ListAttackLogs method to use 'attacked_app'...

Update AttackListener filter in ListAttackLogs method to use 'attacked_app' field for improved query accuracy. This change enhances the precision of attack log filtering based on the specified listener.
parent 43717d05
...@@ -955,7 +955,7 @@ func (s *wafService) ListAttackLogs(ctx context.Context, req *AttackLogFilter) ( ...@@ -955,7 +955,7 @@ func (s *wafService) ListAttackLogs(ctx context.Context, req *AttackLogFilter) (
boolQuery.Filter(elastic.NewMatchPhraseQuery("res_name", req.AttackApp).Slop(0)) boolQuery.Filter(elastic.NewMatchPhraseQuery("res_name", req.AttackApp).Slop(0))
} }
if req.AttackListener != "" { if req.AttackListener != "" {
boolQuery.Filter(elastic.NewMatchPhraseQuery("res_name", req.AttackListener).Slop(0)) boolQuery.Filter(elastic.NewMatchPhraseQuery("attacked_app", req.AttackListener).Slop(0))
} }
if req.AttackType != "" { if req.AttackType != "" {
attackTypes := strings.Split(req.AttackType, ",") attackTypes := strings.Split(req.AttackType, ",")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment