made function from dhcp server total user lease

hello again folks.. wish you all good and healthy…

lets to the point

command that working (and repeatly stated):

:global leaseServer1 "dhcpd.120.254/25";
:global leasetotal1 [/ip dhcp-server lease print active count-only where server=$leaseServer1];

how to made that correctly into function because this code below not working:

:global leaseServer1 "dhcpd.120.254/25";
:global FNleasetotal1 do={:global leaseServer1;\
			:ip dhcp-server lease print active count-only where server=$leaseServer1;\
					};

and store the result to new variable seems not right ( no result or empty)

:global leasetotal2 ($FNleasetotal1);

best regards,

FNleasetotal1 do not :return nothing…

:trying :return still return wrong result. ( :put [$function] )
how the proper way or solution ? (or this couldnt make into function?)


best regards,

still not return nothing, also with useless :put [$function] (which means nothing written so randomly).

this function code works:
running in script


:local leaseServer1 "dhcpd.120.254/25";
:local FNleasetotal1 do=[/ip dhcp-server lease print active count-only where server=$leaseServer1];
$FNleasetotal1

best regards,