Forum Discussion

sundogbrew's avatar
sundogbrew
Icon for Altocumulus rankAltocumulus
Mar 26, 2013

irule to pick a number out of a URI and make it the port

I have developers who want to tie everything off the same URL and have it go to different ports on the same group of hosts. If you have been following my posts, it is almost the exact opposite problem I had before but hey that's what keeps it interesting right?

 

So I want to write an Irule that takes URLs like this

 

joe.test.com/8050/someapp/someoption

 

joe.test.com/8060/otherapp/differentoption

 

and convert them to

 

insidepool:8050/someapp/someoption

 

insidepool:8060/otherapp/differentoption

 

 

I would like it to just be a general take the number make it a variable and then put it in the same URI as a port. Or even if I can just say take everything after my original URL joe.test.com and put it after the inside vip with a colon for port.

 

Or do I have to create a pool for each and port and then do an if then else kind of thing? What I would like to do if I can is keep it from being a long rule where everything has to go through this long 20 if then statement to find the right pool.

 

Anyone do anything like this? If so how do you setup the pool? 1.1.1.1:* ??

 

Thank you in advance for your help!

 

Joe

 

20 Replies