Forum Discussion

AjayPra_161698's avatar
AjayPra_161698
Icon for Nimbostratus rankNimbostratus
Jul 27, 2015

Irule not matching the user-agent string "ms search"

Hi all, I have following iRule configured on LTM.

 

when HTTP_REQUEST { set uagent [string tolower [HTTP::header User-Agent]] if { $uagent contains "ms search"} { pool pool-A } else { pool pool-B } } the http requests with user-agent containing "ms search" is not getting matched and hence falling to pool-B.

 

Is there any significance of white space in "ms serach"

 

1 Reply

  • try adding some logging to see what's coming though and see if that gives any indication. Something like this:

    when HTTP_REQUEST {
        set uagent [string tolower [HTTP::header User-Agent]]
        log local0. "UA: '${uagent}'"
    
        if { $uagent contains "ms search"}  {
            log local0. "  No match"
            pool pool-A
        } else {
            log local0. "  Match found"
            pool pool-B
        }
    }