Forum Discussion

Michael_Mangret's avatar
Michael_Mangret
Icon for Nimbostratus rankNimbostratus
Apr 17, 2007

Is it possible in 4.x...

to search the incomming request for a paticular string, then either discard or loadbalance to a paticular pool. I am unable to find any reference material on rule syntax for 4.5.x. If anyone knows where I might find a document that has a syntax list for rules in 4.5, that would be great as well.

 

 

Thanks,

 

 

MM

1 Reply

  • The documentation for v4.x iRules are in the product user manuals available on ask.f5.com. These code samples are from the following link

     

     

    https://tech.f5.com/home/bigip/manuals/bigip4_6_2/bigip4_6_2ref/BIGip_rules.html1208927

     

    Click here

     

     

     

    rule my_rule { 
      if (tcp_content contains "XYZ") {
       use pool xyz_servers
      }
      else if (substr(tcp_content(100), 50, 3)) == "ABC" {
        use pool abc_servers
      }
      else {
        use pool web_servers
      }
    }

     

     

    rule my_rule { 
      if (http_content contains "ABC") { 
        use pool http_pool 
      } 
      else if (http_content_collected < 20) { 
        accumulate 
      } 
      else { 
        discard 
      } 
    }

     

     

    There are a couple of other examples in there but this should get you started.

     

     

    -Joe