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 would explain why the command isn't listed in the disabled Tcl Commands list - it didn't exist.
Since I'm getting the following error, I figure either lassign really isn't supported, or I'm using it wrong:
error: line 392: [undefined procedure: lassign] [lassign $fields \ result cn goAgent goPolicyHierID goSalesID]
So, I'm hoping someone can help me devise an alternative method here:
set content [HTTP::payload]
if { $content ne "" } { log local0. "HTTP::Payload set"}
split into records in new lines
set records [split $content "\n"]
iterate over the records
foreach rec $records { split into fields on colons set fields [ split $rec ":" ]
assign fields to variables
lassign $fields \
result cn goAgent goPolicyHierID goSalesID
Any help would be appreciated.