Forum Discussion

bbowdensa_25884's avatar
bbowdensa_25884
Icon for Altostratus rankAltostratus
Apr 13, 2016
Solved

APM Expression Error on Variable Assignment

Working on an F5 running BIG-IP 11.5.4 and using a Variable Assignment that I have used on many other F5s as shown below.

 

session.logon.last.username = expr { [mcget {session.saml.last.nameIDValue}]}

 

However after applying it I am getting this error in the logs: " 2016-04-12 08:59:32 Rule evaluation failed with error: invalid command name "expr%20%7B%20%5Bmcget%20%7Bsession.saml.last.nameIDValue%7D%5D%7D" 2016-04-12 08:59:32 Variable Assignment Agent: In agent '/Common/emsi-vpn_act_variable_assign_ag', session variable 'session.logon.last.username' not created due to invalid TCL Expression"

 

When I go back into edit the variable assignment the expression is garbled, I'm not sure that has anything to do with the issue but I have not seen that happen before on other F5s.

 

 

  • Opened a support ticket and this ended up being an issue with the browser and the F5 admin page. Deleted all cookies, restarted the browser and entered the expression again and it no longer garbled the expression as it had previously. The expression is now working fine.

     

6 Replies

  • Hi

    I shouldn't think performing a Variable Assign to an expression would be possible. Expression is meant to produce a result, not a variable.

    The correct expression for what I think you're trying to do would be something like...

    session.logon.last.username = Session Variable session.saml.last.identity

    • Lucas_Thompson_'s avatar
      Lucas_Thompson_
      Historic F5 Account
      For session variable assignments, the right-hand side is a TCL command. There is a "simple view" that creates expressions for you, or you can enter it yourself.
    • bbowdensa_25884's avatar
      bbowdensa_25884
      Icon for Altostratus rankAltostratus
      I am using expr { [mcget {session.saml.last.nameIDValue}]} to grab the nameID out of the SAML response and set the session.logon.last.username variable with that value. I have used the same expression on other F5s not sure why I am running into an error hear or why when I go back to edit it, it appears as it does in the attached picture (above)
    • shopkeeper56_23's avatar
      shopkeeper56_23
      Icon for Cirrostratus rankCirrostratus
      You shouldn't need to use an expression to obtain that variable though. Also that expression is incomplete/invalid (see the log entry) so I'm surprised its worked for you in the past (maybe older version?) I suggest you try the variable assignment I mentioned or using the simple view Lucas mentioned.
  • Opened a support ticket and this ended up being an issue with the browser and the F5 admin page. Deleted all cookies, restarted the browser and entered the expression again and it no longer garbled the expression as it had previously. The expression is now working fine.