Forum Discussion
extract number from URI,redirect to pool base on that number
write an irule to extract a number from URL and assign it to variable and redirect it a pool based on that value.
5 Replies
- ltwagnonRet. Employee
Hi Dinesh, could you give an example URI so I can have a better understanding of what you are wanting to do here? I'll do my best to help with a good iRule for you.
Thanks! John
- Dinesh_22825
Nimbostratus
Hi John, The url will be like http://myNNsite.com and where NN can any two digit number. We need to assign NN to a variable and redirect to pool having that specific number in the pool name.
Thanks!
- ltwagnonRet. EmployeeThanks Dinesh...will the two digit number always be between the "my" and "site" in the host name or will move around? Sorry for all the questions!
- Dinesh_22825
Nimbostratus
NP...the two digit number will be moving around.
- Dinesh_22825
Nimbostratus
Hi John,
I figured it out. I did something like this :
set host [HTTP::host] set pattern {[^a-zA-Z][\d\a]} set match [regexp -all -inline $pattern $host] log $match
And I am able to get the first two digit number out of the it!
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com