Greg_33558
Jun 23, 2015Nimbostratus
Equivalent of TCL {*} list expansion for iRules?
iRules (LTM 11.6 HF4) don't appear to support TCL list expansion e.g. {*} or {expand}. I'm trying to concatenate two lists, and the default behavior of lappend is to leave the appended list unexpanded. In TCL 8.5+ the list is expanded using {*}:
tclsh8.6 [~]set foo {a}
a
tclsh8.6 [~]lappend foo [split "b c"]
a {b c}
tclsh8.6 [~]lappend foo {*}[split "d e"]
a {b c} d e
tclsh8.6 [~]lindex $foo 2
d
tclsh8.6 [~]
Any ideas how to do this? I have a list of default coded in an iRule, and would like to allow entries to be appended to the list based on a string variable in a data group.
set http_headers {host content-length content-type referer}
lappend http_headers [split [class lookup more_headers config-datagroup]]
where more_headers is "user-agent accept"... but right now I think I end up with:
{host content-length content-type referer {user-agent accept}}