Forum Discussion

Bryan_Chick_152's avatar
Bryan_Chick_152
Icon for Nimbostratus rankNimbostratus
Oct 17, 2006

Please confirm new iRule is accurate

We're migrating to 9.x. I have a bunch of 4.x rules similar to the one shown below. Can someone please confirm that the syntax for the new 9.x rule is correct?

 

 

Thanks!

 

Bryan

 

 

========

 

OLD RULE

 

========

 

 

if (http_uri contains "/vault/finance") {

 

use pool info.vw.com_Cosworth

 

}

 

else {

 

if (http_uri contains "/vault/logistics_and_process_management/") {

 

use pool info.vw.com_Cosworth

 

}

 

else {

 

discard

 

}

 

}

 

========

 

NEW RULE

 

========

 

 

rule info_vw_com_rule_1 {

 

when HTTP_REQUEST {

 

if {[HTTP::uri] starts_with "/vault/finance"} {

 

pool info.vw.com_Cosworth

 

} elseif { [HTTP::uri] starts_with "/vault/logistics_and_process_management/"} {

 

pool info.vw.com_Cosworth }

 

} else {

 

discard

 

}

 

}

 

1 Reply

  • Actually, I want to drop traces at the start of the rule. This would be the new rule. Syntax, okay?

     

     

    ============================

     

    rule info_vw_com_rule_1 {

     

    when HTTP_REQUEST {

     

    if { [HTTP::method] equals "TRACE" } {

     

    discard

     

    }

     

    elseif { [HTTP::uri] starts_with "/vault/finance"} {

     

    pool info.vw.com_Cosworth

     

    } elseif { [HTTP::uri] starts_with "/vault/logistics_and_process_management/"} {

     

    pool info.vw.com_Cosworth }

     

    } else {

     

    discard

     

    }

     

    }

     

    ============================