I’m trying to create a script that will parse the comments of the ip table and look for entries that are not dynamic and not disabled, and do NOT contain the text “disregard”. I cannot for the life of me find the proper syntax. Here is what I have:
:foreach vLease in=[/ip dhcp-server lease find where (!dynamic && !disabled) ] do={
Can someone help me with the syntax for the part that should not contain the text “disregard”?
Thank you.
I have tried everything and searched the forum for hours and I cannot get it.
Also, I’d like to be able to have any phrase that contains the word “disregard” skipped. For example, if the comment in a static lease that is not disabled is “disregard printer”, that particular lease would be skipped in the script.
I thinks this should work
/ip dhcp-server lease print where !dynamic and !disabled and !(comment~"disregard")
I prefer it to:
ip dhcp-server lease print where !(dynamic) && !(disabled) && !(comment~"disregard")
For some reason the regex matching operator “~” requires parenthesis when negated.
Priorities of operators in the syntax is not very clear…
Its crazy but I figured it out about 1 minute before you wrote me back.
Thank you for helping anyway.
I can’t believe how difficult it was to find the syntax.
Thanks again.