Forum Discussion

AlexS_yb's avatar
AlexS_yb
Icon for Cirrocumulus rankCirrocumulus
Mar 20, 2021

irule plus switch plus globbing

Hi

 

  switch -glob [string tolower [HTTP::path]] {

   "/testsso/logout" -

   "/testsso/logout/*" {

}

}

 

I want this to match

/testsso/logout

and

////testsso/logout

 

can i use

 

[/]testsso/logout

 

 

2 Replies

  • Hi AlexS_yb,

    Hope this helps.

    when HTTP_REQUEST {
        if { [string map {"/" ""} [HTTP::uri]] starts_with "testssologout"} {
            #log local0. "[HTTP::uri]"
        }
    }

    I could not find how to do it with regex.

    • AlexS_yb's avatar
      AlexS_yb
      Icon for Cirrocumulus rankCirrocumulus

      Hmm, okay i see how to do it for if then.. I guess I can move that to switch.

       

      cause iam rather new to F5. I have found also you can do HTTP::uri -normalized which removes all of the extra stuff

       

      thanks