Forum Discussion
Using "=" symbol in iRule URL Path
Hey everyone,
I've got an iRule where i send traffic to a specific pool based on the URL path they send in. It works well for most URL paths but i've received a request to add a new pool from a path that contains a "=" (equals) symbol. The F5 either doesnt recognize the = symbol or it thinks im trying to set a parameter. Either way it doesnt match the URL path so it drops the traffic. When i removed the = symbol then it works perfectly. Any thoughts how to make the F5 understand the = is apart of the URL path and nothing more?
Thanks!
7 Replies
- DEJ
Nimbostratus
I don't have access to my lab box to test, but have you tried escaping the '=' with a backslash? \=
- Just tried that but unfortunately no adding the backslash didn't help, it still skipped over it and dropped the traffic.
- DEJ_159363
Cirrus
I don't have access to my lab box to test, but have you tried escaping the '=' with a backslash? \=
- Just tried that but unfortunately no adding the backslash didn't help, it still skipped over it and dropped the traffic.
- Stanislas_Piro2
Cumulonimbus
Hi,
I tried this irule and it detect equals character:
when HTTP_REQUEST { if {[HTTP::uri] contains "=" } { log local0. "[HTTP::uri] : detected"} else { log local0. "[HTTP::uri] : not detected" } }The log is:
May 25 14:59:49 F5adm info tmm[20143]: Rule /Common/detect-equals : /foo=bar/ : detected May 25 14:59:53 F5adm info tmm[20143]: Rule /Common/detect-equals : / : not detected - Stanislas_Piro2
Cumulonimbus
You can use the following irule:
HTTP_REQUEST { if {([HTTP::uri] equals "/") && ([URI::query [HTTP::uri] publication] equals "ecmrc")} { pool Oracle_11i_TLS_Mcmaster_Pool_Test } else {discard} }or
HTTP_REQUEST { switch -glob [HTTP::uri] { "/?publication=ecmrc" { pool Oracle_11i_TLS_Mcmaster_Pool_Test } default { discard } } } - Vijay_E
Cirrus
HTTP::uri - everything from "/" after the domain name to the end.
HTTP::path - everything from "/" after the domain name to the character before the "?"
HTTP::query - everything after the "?"
Roughly: [HTTP::uri] == [HTTP::path] + ? + [HTTP::query]
Example: http://www.example.com:8080/main/index.jsp?user=test&login=check
URI: /main/index.jsp?user=test&login=check PATH: /main/index.jsp Query: user=test&login=check
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