Can Statatistic name be a variable reference?

I’m using statistics collector and i would like to instead of hardcoding a name i would like to reference a flow variable:

where custom_stat_name is a flow variable i defined in my proxy

No.

Can you explain in more detail what you are hoping to accomplish?

Actually i was able to get this working. What I had was i had a proxy that had a StatisticsCollector policy and i wanted the caller of the proxy (another proxy of mine) to pass in the statistic name and then i would extract it from the query param into a flow variable and then reference it like:

where _entry is also another flow variable. What i ended up doing is i created many elements and did not use a reference to the name so i had something like:

and if stat1 was in the incoming request like ?stat1=123

and i extracted out stat1 query param into _stat1 flow far but stat2 was not in the request then the above would only write stat1 to statistics and stat2 would be ignored. Conversely if i called my proxy like ?stat2=456 then only stat2 would be written to statistics. I’m not sure if this is the best way but this is how i was able to implement what i needed.

Ahh Clever!