Lua filter to specific url

Hello,
How to limit lua filter for a specific url, i tested but it seems does not working.
i tried 2 ways:

ACL:
acl acl_pagetomodify path -i -m beg /modifpages
filter lua.applymodify if acl_ pagetomodify

Variable:
acl acl_pagetomodify path -i -m beg /modifpages
http-request set-var(txn.tomodify) str(true)
filter lua.applymodify

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

How can i do to linit filter to specific url?

Thanks

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.

Thanks for your help