For more information regarding the security incident at F5, the actions we are taking to address it, and our ongoing efforts to protect our customers, click here.

Forum Discussion

Robert_47833's avatar
Robert_47833
Icon for Altostratus rankAltostratus
Nov 14, 2011

how to use switch to match datagroup

1:there is a datagroup:cjj

 

how to use switch to match this group

 

 

switch -glob [HTTP::path] {

 

"cjj" xxxx ???

 

 

2:

 

 

switch -glob [HTTP::path] { "*jpg" - "*bmp" - "*gif" - "*png" - "*img" - "*ico" - "*js" - "*css" - "*swf" - "*swz" - "*vbs" - "*html" - "*htm" - "*csv" - "*txt" - "*crossdomain.xml" {pool xyz}

 

 

in this case,should I create a variable uri to replace [HTTP::path] to make the irule more efficent?

25 Replies

  • how about this one?

     

    [URI::query [HTTP::uri]]

     

    this one should be set as variable if I use it multiple times,right?

     

    it can be seen as operation against command?
  • hoolio's avatar
    hoolio
    Icon for Cirrostratus rankCirrostratus
    The value for [HTTP::uri] is cached in the HTTP_REQUEST event (for that single connection) so you wouldn't need to save it to a variable. If you're running another operation against the output multiple times, it would be more efficient to save the value to a variable the first time.

     

     

    Aaron
  • thanks,Aaron

     

    [URI::query [HTTP::uri]] can be considered as r operation against the [HTTP::uri],right?
  • [URI::query [HTTP::uri]] can be considered as r operation against the [HTTP::uri],right?i think so.
  • hoolio's avatar
    hoolio
    Icon for Cirrostratus rankCirrostratus
    Yes, if you need to run an operation against a command more than once, you should save the value to a variable so you don't need to run the same operation twice.

     

     

    Aaron