Forum Discussion
- jgranieriNimbostratus
there are two ways to do this. one is to use datagroups in the irule and use class match statements. in the datagroups specify the strings u want to match on. below is the straigh irule reference u can either use a pool as an action or simply add a reject statement then and default for all other actions
when HTTP_REQUEST { if { ( [string tolower [HTTP::uri]] contains "/testconnect/") && ( [string tolower [HTTP::header User-Agent]] starts_with "java/" ) } { pool _something } else { HTTP::respond 200 content "not allowed..." reject } }
- Stefan_KlotzCumulonimbus
Hi Rajesh,
can you provide an example request? I mean where is the site ID located? Is this part of the URI, a query parameter, a header or cookie value? And what's the exact name of it?
Ciao Stefan :)
- Stefan_KlotzCumulonimbus
Hi Rajesh,
you still forgot to mention the exact name of the header or query parameter or section in the URI, where to look for.
Ciao Stefan :)
- Stanislas_Piro2Cumulonimbus
Hi,
are you sure "Site ID" is the header name?
I never saw a header name with space...
As requested Stefan, can you provide an example of the request? because, you are talking about parameter, header name... with is not the same.
when requesting
the request is:http://www.company.com/path?q=test&lang=en
GET /path?q=test&lang=en HTTP/1.1 Host: www.company.com user-agent: Mozilla...
in this request:
- URI is /path?q=test&lang=en
- path is /path
-
parameters:
- q with value test
- lang with value en
-
headers:
- Host with value www.company.com
- user-agent with value Mozilla...
So, what do you want to filter?