Get the interface name in dhcp-client

Good night,

i need to monitor the status of a interface in the dhcp-client module, status like, bound, searching, renewing, etc,

i need to get the interface name to make some process but nothing works for me, i have 12 wan interfaces, all of them with dhcp-client active
i try with

:local intname [ /ip dhcp-client get [/ip dhcp-client find status=bound ] interface ];

:local theName [ /ip dhcp-client get interface ];

nothing works, i cant get the name of the interface,

thanks any help

for example paste in your terminal.

foreach i in=[ip dhcp-client find ] do={
local name [ ip dhcp-client get $i interface ]
put $name
}

thanks, it works, but doesnt understand why doesnt work by the way y test…
thanks again

what are you doing?

tratando de obtener los nombres de las interfaces que estan en dhcp-client para luego preguntar sus defaults gateways y crear las rutas dinamicamente

sorry for write in spanish

im trying to get the interfaces names to use it for recreate the routes dynamically