I'd like to log the wildcard path used to match routes so that we can determine usage by endpoint without regard to the path variables used. Our proxies currently include route rules in this pattern:
<RouteRule name="/centres/{centre_id}/movies/{movie_id}"> <TargetEndpoint>movie_service</TargetEndpoint> <Condition>(proxy.pathsuffix MatchesPath "/centres/{centre_id}/movies/{movie_id}")</Condition> </RouteRule>
Where centre_id might be sanfrancisco and movie_id might be 12345.
If there is a flow variable to access the route rule name matched then I'd be all set with no additional processing. Alternatively, the identical value is in the matched path pattern, if that is available.
Solved! Go to Solution.
@George Shaw , Did you check below flow variable ?
route.target
route.target
returns the target, not the rule that RouteRule that fired. We have many RouteRules that fire for the same target.
That works. Thanks!
Thanks for this, @Sai Saran Vaidyanathan. Didn't know about that variable. I've double-checked, and it does return the RouteRule name. I've added this to the Variables reference. @George Shaw, please confirm this worked for you.
Awesome.. thanks @Floyd Jones
Yes, this worked.
User | Count |
---|---|
1 | |
1 | |
1 | |
1 | |
1 |