Forum Discussion

Robert_47833's avatar
Robert_47833
Icon for Altostratus rankAltostratus
Mar 11, 2015

HTTP::uri "/new-page[HTTP::uri]" without pool specified

when HTTP_REQUEST {
        if {[HTTP::host] ends_with .com and [HTTP::path] equals /}    {
            HTTP::uri "/new-page[HTTP::uri]";
            }
            xxxxx-other irule logic-xxxx
           }
        } 

there is no pool in the first if statment because I want the following irule match the "1.com/?xyz" request.,what will happen to the call 1.com/ if it is matched in the xxxxx-other irule logic-xxxx?

I tried make a log in xxxxx-other irule logic-xxxx for /new-page*,it mess up the irule

       "/new-page*"  {
       log local.0 "[HTTP::uri]"
       }

1:what is the correct way achieve HTTP::uri "/new-page[HTTP::uri]" in this case?

  • I made some logs ,I found that the request changed to /new-pagexxx ,when it is evluated by xxxxx-other irule logic-xxxx,is it an expected behavior?

     

    yes, i believe so.

     

    • Robert_47833's avatar
      Robert_47833
      Icon for Altostratus rankAltostratus
      sorry,I made noise here ,haha I want to let irule change the HTTP::uri ,but don't put pool syntax in this piece,because I want xxxxx-other irule logic-xxxx to handle it ,and sent request to pool. HTTP::uri "/new-page[HTTP::uri]" I made some logs ,I found that the request changed to /new-pagexxx ,when it is evluated by xxxxx-other irule logic-xxxx,is it an expected behavior?
    • Robert_47833's avatar
      Robert_47833
      Icon for Altostratus rankAltostratus
      sorry,I made noise here ,haha I want to let irule change the HTTP::uri ,but don't put pool syntax in this piece,because I want xxxxx-other irule logic-xxxx to handle it ,and sent request to pool. HTTP::uri "/new-page[HTTP::uri]" I made some logs ,I found that the request changed to /new-pagexxx ,when it is evluated by xxxxx-other irule logic-xxxx,is it an expected behavior?
  • I made some logs ,I found that the request changed to /new-pagexxx ,when it is evluated by xxxxx-other irule logic-xxxx,is it an expected behavior?

     

    yes, i believe so.

     

    • Robert_47833's avatar
      Robert_47833
      Icon for Altostratus rankAltostratus
      and if the syntax in xxxxx-other irule logic-xxxx is : "/new-pagexxxx" { log lcoal0. "[HTTP::uri]" } in log,I can see request is matched by this piece syntax,but page is down, This behavior confused me..... help me,Nitass
  • I made some logs ,I found that the request changed to /new-pagexxx ,when it is evluated by xxxxx-other irule logic-xxxx,is it an expected behavior?

     

    yes, i believe so.

     

    • Robert_47833's avatar
      Robert_47833
      Icon for Altostratus rankAltostratus
      and if the syntax in xxxxx-other irule logic-xxxx is : "/new-pagexxxx" { log lcoal0. "[HTTP::uri]" } in log,I can see request is matched by this piece syntax,but page is down, This behavior confused me..... help me,Nitass
  • "/new-pagexxxx" {

    log lcoal0. "[HTTP::uri]"

    }

    is this correct syntax? can you post the irule?

     tmsh list ltm rule (name)
    
  •    if {[HTTP::host] ends_with ".com" and [HTTP::path] equals "/"}   {
            HTTP::uri "/new-page[HTTP::uri]"
        }
    
        xxxxxxxxxxxxxxxxxxother-irule-logic---------------------
        if {[HTTP::path] starts_with "/new-page"} {
        log local0.alert "[HTTP::uri]"
        }
        xxxxxxxxxxxxxxxxxxother-irule-logic---------------------
    
    • nitass's avatar
      nitass
      Icon for Employee rankEmployee
      i do not see anything obviously wrong in the irule. is the page down because of the irule? was there any error in /var/log/ltm? have you tried tcpdump when the problem was happening?
    • Robert_47833's avatar
      Robert_47833
      Icon for Altostratus rankAltostratus
      I am confused .if I put syntax outside the default syntax if {[HTTP::path] starts_with "/new-page"} { log local0.alert "[HTTP::uri]" } the page is up but if I use it in a switch with a default action, "/new-homepage*" { log local0.alert "hellohello [HTTP::uri]" } default { pool xxxx return } } } it is down. no other reason to make it down,only irule.
    • Robert_47833's avatar
      Robert_47833
      Icon for Altostratus rankAltostratus
      ah,maybe it works in this way: when the syntax is out of the switch -glob [HTTP::path] which has default pool,this request will be distributed to this default pool since no match in previous condition. but if I evulate it in this switch -glob [HTTP::path] which has default pool,it will not be distributed to default rule,so LB failed....