Forum Discussion

Jo_31162's avatar
Jo_31162
Icon for Nimbostratus rankNimbostratus
Dec 17, 2013

Persistence based on Header value

Hi all, I need to configure an iRule in order to make persistence based on hexadecimal value in HTTP header. This field is variable and can be 8 number/characters long. I was thinking of using Universal profile persistence but I'm not an expert of TCL language. Could someone help me? Thanks in advance for any help.

 

  • nathe's avatar
    nathe
    Icon for Cirrocumulus rankCirrocumulus

    GiJo,

    If it's simply a case of the HTTP Header value is what you want to persist on, and not a substring of this value, then something like this should help:

    when HTTP_REQUEST {
      if { [HTTP::header exists "Name"] } {
        persist uie [HTTP::header "Name"]
      }
     }
    

    Hope this helps,

    N

  • Many thanks again Nathan. So,with GET command receive something like this: GET /bin HTTP/1.1 Host: x.x.x.x Accept: / z-y:012AB123

     

    My interest field is after z-y: How LTM can read this variable hexadecimal value? Rgds

     

  • nathe's avatar
    nathe
    Icon for Cirrocumulus rankCirrocumulus

    Try this then:

    when HTTP_REQUEST {
     if { [HTTP::header exists "Accept"] } {
     persist uie [findstr [HTTP::header Accept] /z-y: 5 end ] 
     }
    }
    

    Hope this helps,

    N

  • Hi all again, sorry for my later but customer has stopped all test for Christmas holidays. Regarding my last analisys,I saw that client produce this http requests at first access:

     

    Dec 20 16:14:35 slot1/office-01 info tmm[20803]: Rule /Common/_log : BL 01DE57DB-01-0100002A-09CD-6C657E1E3A66B251BB0721F84F5B63D9-AA2D6AC5-0000000000000000

     

    Dec 20 16:14:35 slot1/office-01 info tmm[20803]: Rule /Common/_log : BC 01DE57DB-01-0100002A-09CD-5B93234019D664D8E5B5EDDA2EC3A0EA-AA2D6AC5-0000000000000000

     

    Dec 20 16:14:35 slot1/office-01 info tmm1[20803]: Rule /Common/_log : default 01-01DE57DB-0100002A-00000001-02-9839481D834EAD2B-01-FF9483C5

     

    Dec 20 16:14:36 slot1/office-01 info tmm[20803]: Rule /Common/_log : default 01-01DE57DB-0100002A-00000002-02-88DF28915BCEF2D7-01-64793012

     

    That are two GET and two POST

     

    Subsequently, traffic from the same previous client are two POST:

     

    Dec 20 16:15:12 slot1/office-01 info tmm1[20803]: Rule /Common/_log : default 01-01DE57DB-0100002A-00000003-02-ACD18B62E259B7C0-01-D8E547FD

     

    Dec 20 16:15:13 slot1/office-01 info tmm[20803]: Rule /Common/_log : default 01-01DE57DB-0100002A-00000004-02-DC1E968BBC75898F-01-AFAF3DF6

     

    So, I need to persist session on 01DE57DB value that is a VARIABLE numeric value that BIGIP decode into hexadecimal value.

     

    Is it possible to do? BRgds

     

    • abvaidya_182376's avatar
      abvaidya_182376
      Icon for Nimbostratus rankNimbostratus
      Looking for answer to a similar question posted at below link. Please respond in case you know about it https://devcentral.f5.com/s/feed/0D51T00006i7ZqISAU