howdy skillfully mt people,
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)
:local ilm {:toarray [/interface list member print as-value where list=IL_wanif]};put $ilm
result with:
.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”)
: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");
result:
expected result list of interfaces array
this will populate and giving result list of interfaces
:foreach interface in=[/interface list member print as-value where list=IL_wanif] do={:put ($interface->"interface")}
result:
eth0_wlan0
eth0_lte3
eth0_lte10
eth0_lte0
eth0_lte2
eth0_lte1
this command will fail to store result into array:
:foreach interface in=[/interface list member print as-value where list=IL_wanif] do={:global ilm [:toarray ($interface->"interface")]}
it only store 1 to variable the last interface let say “eth0_lte1”
any help would be appreciated..
regards,