How can I search in the leases list if I want to find a host-name that contains something?
But also, on the command line even,
/ip dhcp-server lease print where host-name = “something” ;; spits an error on “=”
/ip dhcp-server lease print where host-name is “something” ;; no error but no result, and ‘is’ is colored red
/ip dhcp-server lease print where host-name in “something” ;; no error and ‘in’ is colored yellow, but the result still is empty.
/ip dhcp-server lease get [find where host-name in “something”] ;; ‘in’ colored yellow, but the answer is ‘no such item’.
What am I missing?
(also need this to work in the on-lease script).
Thanks, this finds and prints all that the host-name is exact; But what if I want it to ‘contain’ the part string? it is possible on Winbox… (ok I know this may mean nothing but still.)
(tried
/ip dhcp-server lease;:foreach i in=[find where host-name in “part i want to find”] do={:put [get $i]}
/ip dhcp-server lease;:foreach i in=[find where “part i want to find” in host-name] do={:put [get $i]}
no results?