Forum Discussion
Jean_42123
Nimbostratus
Sep 25, 2010URGENT - HELP required
Guys,
I am trying to write down the below i-rule but i am getting an error saying [undefined procedure: else][else{discard}]
could you please advise how to fix it ?
when HTTP_REQUEST {
if {[HTTP::uri] contains "/mmsc.omanmobile.om:10021/mmsc" } {
pool NWG_WAP2
}
else {
discard
}
}
Thanks in advance
Jean
5 Replies
- The_Bhattman
Nimbostratus
Hi Jean,
You have the right syntax. My thoughts are that it's the spacing in the right spots
In other words, if your iRule displays similar to the following you could receive the error.when HTTP_REQUEST { if {[HTTP::uri] contains "/mmsc.omanmobile.om:10021/mmsc" } { pool NWG_WAP2 } else { discard } }
So then you can change it to the following which should work:when HTTP_REQUEST { if {[HTTP::uri] contains "/mmsc.omanmobile.om:10021/mmsc" } { pool NWG_WAP2 } else { discard } }
BTW: The "/mmc.omanmobille.om:10021/mmsc" doesn't look like the correct syntax in a URI.
Is this original URL suppose to be http://mmc.omanmobille.om:10021/mmsc" ? if so then the URI would actually be "/mmsc"
I hope this helps
Bhattman - The_Bhattman
Nimbostratus
Hi Jean,
Can you list each header information. Because in a URL string "http://mmsc.omanmobile.om:10021/mmsc" you have HTTP::host which is "mmsc.omanmobile.om" and HTTP::uri is "/mmsc"
Bhattman - Jean_42123
Nimbostratus
Hi,
I am listing the header informations below as I can see them from wireshark....
Request Method: POST
Request URI: http://mmsc.omanmobile.om:10021/mmsc
Request Version: HTTP/1.1
Host: mmsc.omanmobile.om:10021\r\n
Thanks - Jean_42123
Nimbostratus
The script would look like this if i want to use the [HTTP::host] in the if statement, Correct?when HTTP_REQUEST { if {[HTTP::host] contains "mmsc.omanmobile.om" } { pool NWG_WAP2 } else { discard } }
BR/Jean - Chris_Miller
Altostratus
Posted By Jean on 09/26/2010 12:38 AM The script would look like this if i want to use the [HTTP::host] in the if statement, Correct?when HTTP_REQUEST { if {[HTTP::host] contains "mmsc.omanmobile.om" } { pool NWG_WAP2 } else { discard } }
BR/Jean That's correct.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* 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
Discover DevCentral Connects
