problem:
Parse out --> /interface list member of list "IL_wanif" into array variable will result with empty variable.
IL_wanif members -> wlan0 and inactive lte1-4 ( let say lte1,lte2,lte3,lte4)
Code: Select all
:local ilm {:toarray [/interface list member print as-value where list=IL_wanif]};put $ilm
result with:
Code: Select all
.id=*55;comment=;interface=eth0_wlan0;list=IL_wanif;.id=*5d;comment=;interface=eth0_lte3;list=IL_wanif;.id=*61;comment=;interface=eth0_lte10;list=IL_wanif;.id=
*62;comment=;interface=eth0_lte0;list=IL_wanif;.id=*65;comment=;interface=eth0_lte2;list=IL_wanif;.id=*66;comment=;interface=eth0_lte1;list=IL_wanif
looks almost correct. then little more specific with ($ilm ->"interface")
Code: Select all
:local ilm {:toarray [/interface list member print as-value where list=IL_wanif]->"interface"};put $ilm
or
:global ilm {:toarray [/interface list member print as-value where list=IL_wanif]};put ($ilm->"interface");
<empty>
expected result list of interfaces array
this will populate and giving result list of interfaces
Code: Select all
:foreach interface in=[/interface list member print as-value where list=IL_wanif] do={:put ($interface->"interface")}
Code: Select all
eth0_wlan0
eth0_lte3
eth0_lte10
eth0_lte0
eth0_lte2
eth0_lte1
Code: Select all
:foreach interface in=[/interface list member print as-value where list=IL_wanif] do={:global ilm [:toarray ($interface->"interface")]}
any help would be appreciated..
regards,