Forum Discussion

VK_136173's avatar
VK_136173
Icon for Nimbostratus rankNimbostratus
May 21, 2015

iRule “contains” syntax problem

I am having a problem with a User-Agent "contains" syntax.

 

User-Agent header captured in the logs is User-Agent = {OC/15.0.4719.1000 ('Skype for Business')}.

 

iRule statement contains "OC/15.0.4719.1000" works. If I specify contains "Skype" it does not seem to work. Is it because in the HTTP header it is enclosed in single quotes?

 

Thanks,

 

VK

 

4 Replies

  • mikeshimkus_111's avatar
    mikeshimkus_111
    Historic F5 Account

    Hi, I just tested this with a Skype client and it's working for me. Can you post your iRule code here, please?

     

    thanks

     

  • Here it is:

      set uagent [string tolower [HTTP::header User-Agent]]
      if { $uagent contains "lync" or $uagent contains "skype" }
    
  • mikeshimkus_111's avatar
    mikeshimkus_111
    Historic F5 Account

    Does it work if you use this syntax:

    if { [HTTP::header "User-Agent"] contains "Skype" }  {
         log local0. "Skype found!"
     }
    
  • Your pointed me in the right direction. It turns out that Skype also uses “MS-WebServices” user-agent when connecting to Exchange EWS. Thanks.