dhcp-server lease lease-time can't be used in scripts?

Hi,
I have a simple script in dhcp-server :

ip dhcp-server lease set lease-time=00:10:00 [find where dynamic =no]

(the default ‘dynamic’ lease time is 14 days, this is to make certain tasks easier, but when it’s set static, it’s ‘known’ and ‘on the record’, and the lease-time can then be changed to more ‘realistic’ value).

But, this creates a lot of ‘dhcp lease changed’ messages in log (with topic system, info, so kinda hard to filter without nuking the entire log stream)

Unfortunately, simple

 [find where dynamic=no and lease-time !=10m]

doesn’t work… (also tried 00:10:00 and 0d 00:10:00, same result…)
(doesn’t work = does not change anything or just continues as if the lease-time comparison wasn’t there at all)

To that end i tried the following commands on terminal, with zero results given, or errors returned:

> ip dhcp-server lease find where lease-time ~10m
> ip dhcp-server lease find where lease-time ~00:10:00
> ip dhcp-server lease find where lease-time =:totime 10m
> ip dhcp-server lease find where lease-time =:totime 00:10:00
> ip dhcp-server lease find where "lease-time" =:totime 00:10:00
> ip dhcp-server lease find where "lease-time" = 00:10:00  
> ip dhcp-server lease find where "lease-time" =10m      
> ip dhcp-server lease find where (lease-time) =10m  
> ip dhcp-server lease get value-name=lease-time [find where dynamic =no]
invalid internal item number
> ip dhcp-server lease get value=lease-time [find where dynamic =no]     
invalid internal item number
> ip dhcp-server lease get lease-time [find where dynamic =no]      
syntax error (line 1 column 26)

Can lease-time be even used as a test argument in any script? It can be read (via print or gui) but why script treats it as write-only value?

Thanks in advance
Hope it makes sense.

you forget everytime to not put extra space

x=1 rigt
x =1, x= 1 or x = 1 wrong

:put [/ip dhcp-server lease find where dynamic=no and lease-time=1h]
:put [/ip dhcp-server lease find where dynamic=no and lease-time=60m]
:put [/ip dhcp-server lease find where dynamic=no and lease-time=01:00:00]

:put [/ip dhcp-server lease find where dynamic=no and lease-time!=1h]
:put [/ip dhcp-server lease find where dynamic=no and lease-time!=60m]
:put [/ip dhcp-server lease find where dynamic=no and lease-time!=01:00:00]

ip dhcp-server lease set lease-time=00:10:00 [find where dynamic =no]
–>>

/ip dhcp-server lease set [find where dynamic=no and lease-time!=00:10:00] lease-time=00:10:00

# or more clear

/ip dhcp-server lease set [find where dynamic=no and lease-time!=10m] lease-time=10m

Thank you!..
So simple…
:slight_smile: