Print Command

Hello there
i want to get in print command only the one column results.
ip interface print , BUT to get only the NAME
or
ip hotspot user print , and AGAIN ONLY the usernames
How is that possible?
Thank you!

foreach a in=[/interface find] do={:put [interface get $a name]}

Hi,
I have a similar question it is not print the output in the terminal , but to the array.

Let’s say ,

:global a [/interface print as-value] , and you will get an array with all the interfaces info,

If I just want to get the names of the interface in the array, how to get it ?
the expected result kind of like: a={ ether1;ether2; .. ; wlan1} or a={ {ether1}; {ether2}; …, {wlan1} }

Thank you !

Not exactly sure what you like to do.

This will get all interface in to array list and then print it:

{
:local list
 /interface ethernet
 :foreach i in=[find] do={
	:set list ($list,[get $i name])
	} 
:put $list
}



ether1;ether2;ether3;ether4;ether5

I do not think you can use as-value with multi line.

This works

:put ([/system clock print as-value ]->"date")          
feb/05/2021

Not OK

:put ([/interface ethernet print as-value ]->"name")

This is exactly what I want. I tried with “print as-value” but no luck. Looks like it is not possible to “print as-value” for only one properties/field.
Thank you !