Forum Discussion
iapp::get_items -filter question...
I am looking to present in a dropdown list a selection of pools which end in either "_DC1" or "_DC2", but I can't get the syntax correct... various formats I have tried..
return [iapp::get_items -filter NAME =~ "_DC[12]$" ltm pool]
return [iapp::get_items -filter NAME = "_DC[12]$" ltm pool]
return [iapp::get_items -filter NAME ~ "_DC[12]$" ltm pool]
return [iapp::get_items -filter NAME =~ /_DC[12]$/ ltm pool]
return [iapp::get_items -filter NAME = /_DC[12]$/ ltm pool]
I get various error messages - such as invalid command "12" while executing "12" .... Can anyone help with the correct syntax? BTW - this is on BIG IP LTM V12.1.2 (2.0.276) Thanks Neil
- crodriguezRet. Employee
Have you tried escaping the brackets around the 12. For example, "_DC\[12]\$"
- Neil_Marks
Nimbostratus
Tried
and"_DC\[12]\$"
- same error 😞"_DC\[12\]$"
- candcgroup_2467
Nimbostratus
is probably being interpreted by TCL as command. Instead, perhaps your pattern should be a string literal, e.g.[12]
.{_DC[12]$}
Otherwise, have you tried not using the
argument, but instead filtering with TCL's-filter
?lsearch -regexp -inline
Depends on whether F5's TCL is up-to-date, but maybe:
choice dc_pools { [lsearch -regexp -all -inline [iapp::get_items ltm pool] {_DC[12]$}] }
- Neil_Marks
Nimbostratus
Tried both approaches above and both fail... the lsearch one needed a tcl before the 1st {.. but it still failed as it effectively tried to execute a command name called the pools which where matched... without the tcl, the import of the template failed due to invalid characters "[" and a bunch of others... :-(
- candc
Cirrus
is probably being interpreted by TCL as command. Instead, perhaps your pattern should be a string literal, e.g.[12]
.{_DC[12]$}
Otherwise, have you tried not using the
argument, but instead filtering with TCL's-filter
?lsearch -regexp -inline
Depends on whether F5's TCL is up-to-date, but maybe:
choice dc_pools { [lsearch -regexp -all -inline [iapp::get_items ltm pool] {_DC[12]$}] }
- Neil_Marks
Nimbostratus
Tried both approaches above and both fail... the lsearch one needed a tcl before the 1st {.. but it still failed as it effectively tried to execute a command name called the pools which where matched... without the tcl, the import of the template failed due to invalid characters "[" and a bunch of others... :-(
Recent Discussions
Related Content
* 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