Forum Discussion

Jean_42123's avatar
Jean_42123
Icon for Nimbostratus rankNimbostratus
Sep 25, 2010

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

     

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