Forum Discussion

southern_shredd's avatar
Mar 17, 2022

irule matching variable in uri

  We are having trouble with an irule that matches a value in a uri and send it to a different pool. The value is the last 2 digits in the uri example: https://testinguri.dev.no:443/A2ABC/GT_10...
  • CA_Valli's avatar
    Mar 17, 2022

    Hello, this should do

    when HTTP_REQUEST {
      if {[HTTP::path] starts_with "/A2ABC/" && [class match [HTTP::query]] eq query-data-group }{ pool variable_pool } 
    }

     

    I would suggest using a data-group for easier management and scalability on URI values, You'll need a string-type data group named "query-data-group" (to match my example) populated like this 

    ltm data-group internal query-data-group {
        records {
            env=02 { }
            env=05 { }
        }
        type string
    }

    Regards

    CA