Forum Discussion

Chris_Schaefer1's avatar
Chris_Schaefer1
Historic F5 Account
Apr 13, 2007

peristence on tcp string

We're trying to peristence on a string in an encrypted tcp session.

 

After the ssl handshake, the first tcp packet has a user id in the form

 

xxxxx@website.com then a lot of binary data follows. We would like to persist based upon the xxxxx value and have tried the following irule but are not getting persistence.

 

 

when CLIENTSSL_HANDSHAKE {

 

TCP::collect 300

 

}

 

 

when CLIENT_DATA {

 

set userID [regexp -nocase {([0-9]*)@website.com} [TCP::payload]]

 

if { $userID ne ""} {

 

log local0. "userID is ..$userID..end"

 

persist uie $userID 1800

 

}

 

else {

 

log local0. "userID not found"

 

pool no-ID

 

}

 

TCP::release

 

}

 

 

Although sniffing confirms the string is there, the logs show userID not found...

 

Any help would be much appreciated.
  • Colin_Walker_12's avatar
    Colin_Walker_12
    Historic F5 Account
    I'd try adding -inline to the regexp, or changing the way you're capturing the variable:

    From the TCL docs here Click here, the base formate for the regexp command is:

    regexp ?switches? exp string ?matchVar? ?subMatchVar subMatchVar ...?

    So something like this should get you there:

    
      set userID [regexp -nocase -inline { [ 0-9 ]+@website.com} [TCP::payload] ]

    HTH,

    Colin