Technical Forum
Ask questions. Discover Answers.
cancel
Showing results for 
Search instead for 
Did you mean: 

help with irule string match

HarshadS
Altostratus
Altostratus

Hi,

How can I parse an HTTP URL to then send https://www.example.com/foo/index.html to pool A and https://www.example.com/bar/index.html to pool B?

Basically I need to parse the first part of the HTTP::uri (/foo/ and /bar/) and switch based on that.

 

Can someone point me to some documentation or help me in how I can get this to work?

 

1 ACCEPTED SOLUTION

xuwen
MVP
MVP

when HTTP_REQUEST {

switch -glob [HTTP::uri] {

"/foo/*" { pool poolA }

"/bar/*" { pool poolB }

default { pool pool_default }

}

}

View solution in original post

2 REPLIES 2

xuwen
MVP
MVP

when HTTP_REQUEST {

switch -glob [HTTP::uri] {

"/foo/*" { pool poolA }

"/bar/*" { pool poolB }

default { pool pool_default }

}

}

HarshadS
Altostratus
Altostratus

Thanks xuwen! that was exactly what I needed!