Forum Discussion
Blake_79204
Feb 08, 2012Nimbostratus
lassign alternative
I'm having a hard time finding documentation for this that is specific to Big-IP v 11, but it looks like iRules are based on Tcl 8.4.6. The command lassign wasn't introduced in Tcl until v8.5. This ...
Blake_79204
Feb 20, 2012Nimbostratus
OK - changing parameters a bit here. The initial data is all on one line, with key/value pairs seperated like this:
cn=JoeAgent | Intradoc_Hrchy_Tx=somevalue | first_nm=Joe | last_nm=Agent | de3fault_agnt_id=123fake | EMAIL_ADR=agentjoe@fake.org
The keys and variables may change without notification - so hardcoding them in as a static::field is less than ideal. The initial data is already stored as a variable (let's say it's $attributes).
We can split the $attributes into records based on "|", and then split the records into fields based upon "=".
Where I'm getting stumped is populating a table with those fields. How do I get it to look something like this:
key | value
$field1 | $field2
$field3 | $field4 etc.
I can then pull the data from the table, because I'll know the key name that I'm looking for when I need to pull it back from the table- so I can do a
table lookup $field3
for example, substituting the value of $field3 and getting the $field4 value returned.
Any help would be appreciated.
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects