Forum Discussion

Sumit_Singh_383's avatar
Sumit_Singh_383
Icon for Nimbostratus rankNimbostratus
Apr 02, 2019
Solved

Please help me in below iRule which is not working for me.

 

Hi Team, my above irule is not working. Please help me on urgent basis. I want to use this irule to identify the client browser then re-direct their request to specific pool member.

 

  • Hi ,

    Try this:

    when HTTP_REQUEST {
    if { [HTTP::header User-Agent] contains "ipad" }  {
            pool Pool-2    
    } elseif { [HTTP::header User-Agent] contains "Android" } {
            pool Pool-3
    } else { 
            pool Pool1 
    }
    
    }
    

    Many thanks,

    Karim

8 Replies

  • Hi ,

    Try this:

    when HTTP_REQUEST {
    if { [HTTP::header User-Agent] contains "ipad" }  {
            pool Pool-2    
    } elseif { [HTTP::header User-Agent] contains "Android" } {
            pool Pool-3
    } else { 
            pool Pool1 
    }
    
    }
    

    Many thanks,

    Karim

    • Sumit_Singh_383's avatar
      Sumit_Singh_383
      Icon for Nimbostratus rankNimbostratus

      Hi Karim, Thank you so much. It is working for me now.

       

      May i know what mistake I was doing.

       

      Regards, Sumit Singh

       

    • Karim_Benyello1's avatar
      Karim_Benyello1
      Icon for Cirrus rankCirrus

      Hi,

       

      Sure, you typed "IF" while it should be "if". iRules are case sensitive.

       

      Many thanks,

       

      Karim

       

  • Hi ,

    Try this:

    when HTTP_REQUEST {
    if { [HTTP::header User-Agent] contains "ipad" }  {
            pool Pool-2    
    } elseif { [HTTP::header User-Agent] contains "Android" } {
            pool Pool-3
    } else { 
            pool Pool1 
    }
    
    }
    

    Many thanks,

    Karim

    • Sumit_Singh_383's avatar
      Sumit_Singh_383
      Icon for Nimbostratus rankNimbostratus

      Hi Karim, Thank you so much. It is working for me now.

       

      May i know what mistake I was doing.

       

      Regards, Sumit Singh

       

    • Karim's avatar
      Karim
      Icon for Cirrus rankCirrus

      Hi,

       

      Sure, you typed "IF" while it should be "if". iRules are case sensitive.

       

      Many thanks,

       

      Karim