buger / goreplay

GoReplay is an open-source tool for capturing and replaying live HTTP traffic into a test environment in order to continuously test your system with real data. It can be used to increase confidence in code deployments, configuration changes and infrastructure changes.
https://goreplay.org
Other
18.62k stars 20 forks source link

Cannot filter requests using capturing groups or advanced regex #1255

Open Udaykumar519 opened 2 months ago

Udaykumar519 commented 2 months ago

Hi,

we are using below version of gor replaying traffic gor_1.3.3_x64.tar.gz

We are not able to correctly capture the requests based on the allow urls pattern

Command used: sudo ./gor --input-raw :8985 --input-raw-bpf-filter "dst port 8985 and inbound" --http-allow-url="solr/im-search/select" --http-allow-url="route=(\bgshard(7|14)\b)(,(\bgshard(7|14)\b))*" --input-raw-allow-incomplete --input-raw-buffer-size 536870912 --output-http="http://testhost:port"

In above command we have added two allow url patterns, one of which pattern says to redirect urls which contains route parameter as follows Allow: route=gshard7,gshard14 or route=gshard14,gshard7, here either of the pattern is valid

dont allow: route=gshard71,gshard141

So, We have added word boundaries for the same requirement

But the command is not capturing requests as expected

Doubt:

  1. can't we write regex on parameters of url?
  2. Can't we write multiple patterns of allow or disallow urls?

pls help

Udaykumar519 commented 2 months ago

@buger any help or suggestions here?