Limit concurrent connections based on part of URI



Cannot find a good example after a fair amount of googling.

Want to concurrent connection limit based on client part of the URI below.

Having a hard time figuring how to parse out /clientX/ in to a var to place in a stick table.

Want to limit any particular client to no more than X connections as a safety valve.

Can someone help?