For more information regarding the security incident at F5, the actions we are taking to address it, and our ongoing efforts to protect our customers, click here.

Forum Discussion

JustCooLpOOLe's avatar
JustCooLpOOLe
Icon for Cirrocumulus rankCirrocumulus
Apr 16, 2021
Solved

Getting the First 10 Characters - iRule Help

Hi,

I'm taking a session variable and inserting it into a header. Now I want to get the first 10 positions of that session variable. Any ideas on the best approach for this? I know string map and string range are a thing but not sure where that needs to be inserted as so not to break anything.

when ACCESS_ACL_ALLOWED {

 

    HTTP::header insert "THING" [ACCESS::session data get session.logon.last.upn]

 

}
  • It's working!

    when ACCESS_ACL_ALLOWED {
     
        set lastupn [ACCESS::session data get session.logon.last.upn]
        
        HTTP::header insert "THING" [string range $lastupn 0 9]
     
    }

1 Reply

  • It's working!

    when ACCESS_ACL_ALLOWED {
     
        set lastupn [ACCESS::session data get session.logon.last.upn]
        
        HTTP::header insert "THING" [string range $lastupn 0 9]
     
    }