For more information regarding the security incident at F5, the actions we are taking to address it, and our ongoing efforts to protect our customers, click here.

Forum Discussion

Dinesh_22825's avatar
Dinesh_22825
Icon for Nimbostratus rankNimbostratus
Apr 09, 2014

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

  • 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

     

  • 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!

     

    • ltwagnon's avatar
      ltwagnon
      Ret. Employee
      Thanks 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!
  • 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!