Forum Discussion

brepav123_22459's avatar
May 25, 2016

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's avatar
    DEJ
    Icon for Nimbostratus rankNimbostratus

    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.
  • I don't have access to my lab box to test, but have you tried escaping the '=' with a backslash? \=

     

    • brepav123_22459's avatar
      brepav123_22459
      Icon for Cirrus rankCirrus
      Just tried that but unfortunately no adding the backslash didn't help, it still skipped over it and dropped the traffic.
  • 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
    
  • 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 }
        }
    }