In lua file i set:
function filter:start_analyze(txn, chn)
local my = txn:get_var(“txn.tomodify”)
if my then
print(‘######START#####LUA##################’…my)
filter.register_data_filter(self, chn)
end
end
filters cannot be enabled conditionally from the config file. Thus if you need to make the filter behave differently based on the URL, you may want to do it in the filter directly. I’ve seen that you already tried that in your second example, however the start_analyze() hook is called before http-request actions are evaluated, so you need to postpone the check in another filter hook (ie: http_headers hook) for this to work.
Another solution could be to define 2 different backends, one with the filter enabled and the other without the filter, and then from the frontend select the proper backend according to request url.