Is there a flow variable that supplies the RouteRule name that activated?

Not applicable

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 Solved
0 7 325
1 ACCEPTED SOLUTION

Hi @George Shaw

Can you check with

route.name

View solution in original post

7 REPLIES 7

@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.

Hi @George Shaw

Can you check with

route.name

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.