Forum Discussion

strohg_116829's avatar
strohg_116829
Icon for Nimbostratus rankNimbostratus
Dec 16, 2014

Group List String Concatenation

I'm slowly migrating web applications from IIS 6 servers to IIS 8.5. What I would like to do is use a one Group List to check if an HTTP_REQUEST ends_with /webappname or contains /webappname/

 

Is there a way to do this with one Group List?

 

In other languages I have used the & or + for string concatenation how would I do it with a Group List? Will the example below (with the right code) work correctly?

 

when HTTP_REQUEST { if { [class match "[string tolower [HTTP::uri]]/" ends_with GL.2003] | [class match "[string tolower [HTTP::uri]]/" contains GL.2003 & "/" ]} { pool server.2003 } else {pool server.2012 } }

 

1 Reply

  • Try something like this. I think it will work. Can't test it right now to verify. You'd probably be better off not using a "." in your names... so I'd change them to GL2003 and server2003 and server2012 based on your example. Also make sure your group list items end in a "/" for the to work correctly.

    when HTTP_REQUEST {
        set uriLower [string tolower [HTTP::uri]]
         As long as your group list items end in a "/" this should work
        if { [class match "${uriLower}/" ends_with GL2003] || [class match "${uriLower}/" contains GL2003] } { 
            pool server2003
        } else {
            pool server2012 
        } 
    }