-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ability for HAR convert to filter by substrings from the entire URL #650
Comments
I think having a regex filter would be more useful, even if it's a bit more complex for users. |
To filter the content of the recorded session, you can use a regex on the Browser Developer Tools to skip domains from the recorded HAR file. You can read how to filter domains on the Closing the issue. |
For the record, we then reverted the deprecation in #1268 because har-to-k6 converter still didn't have full feature parity with the current converter, specifically it still doesn't support creating http.batch requests. |
@ppcano, browsers are not the only tools that generate HAR files, and it's not always easy to filter out domains or URLs. So, I think a feature in the HAR converter to do it would be a good idea, albeit one with a relatively low priority. So, I created grafana/har-to-k6#39... |
Because HAR files are just JSON, it is fairly easy to create a script to pre-filter the HAR based on regex. |
According to the source of convert.go, the HAR converter currently supports the filters
only
andskip
that only accept a domain string.It would be cool if the converter could also filter by substrings (maybe regex even) from the entire URL - i.e. parsing the domain, the path and the query. JMeter, for instance, supports this in its Script Recorder.
For example, something like:
k6 convert --only .*.jsp.* --skip .*ads\..*,.*analysics.js.* myfile.har
with regex ork6 convert --only .jsp --skip ads.,analysics.js myfile.har
for substring matches.The text was updated successfully, but these errors were encountered: