Respond to `request` event but only for filtered flows


#1

Hi,

I’m trying to modify attributes of requests (specifically body/headers/query parameters) but would like to only modify requests that match a view filter, is this possible? Apologies if this is in the documentation somewhere and I missed it.

Thanks,
Nathan


#2

In case anyone runs into a similar issue I realized that the flowfilter class very nicely exposes the capability to filter flows (as its name suggests :smile:). If you import flowfilter then just use the provided match function with a filter expression and flow it will tell you whether the flow matches the expression:

import flowfilter
# will return true if flow matches expression, false otherwise
flowfilter.match(<some filter expression>, <some flow>)