Forum Discussion

Abed_AL-R's avatar
Abed_AL-R
Icon for Cirrostratus rankCirrostratus
Nov 05, 2020

excluding specific uri from datagroup

Hello guys

I'm using this iRule to do redirection with data group:

when HTTP_REQUEST {

if { [class match [string tolower [HTTP::uri]] starts_with myweb_Uri_Data_group] } {

      HTTP::redirect "[class match -value [string tolower [HTTP::uri]] starts_with myweb_Uri_Data_group]"

    }
}

In the data group I have this uri to be redirected:

/myweb/folder1/coronatime

And I what to exclude this uri from datagroup:

/myweb/folder1/coronatime-xyz

What is the best way to exclude specific uri ?

is it using another "if" on the top with return statement ?

or there is another way?

Does the "return" exits the specific if function or exits all the irule?

Because it's written here that it does not exit from the iRule altogether: https://clouddocs.f5.com/api/irules/return.html

Thanks !!

    • Abed_AL-R's avatar
      Abed_AL-R
      Icon for Cirrostratus rankCirrostratus

      That's a problem when have hundreds of URI's starting with /myweb/folder1/coronatime

      • jaikumar_f5's avatar
        jaikumar_f5
        Icon for MVP rankMVP

        Sorry I'm not following you, We are not going to use starts_with or contains, but be using equals. When equals condition is called it will look for exact match of the entire URI.

         

        Can you tell how many you want to exclude from your original.

        And yes you can still create a new DGL for exclusion and then use the return statement to break the flow on the current event.