log statement doesn't

Hughes, Doug Douglas.Hughes at DEShawResearch.com
Thu Apr 14 03:14:20 UTC 2016


I figured out the trick, though it took me a while..

First and foremost, I had to use 'option option125' or it would fail silently.

match if substring(option option125, 7, 7) = "Polycom";

That works.

Thanks for the help. I'm not sure what I could suggest except to make the documentation a little bit clearer about using the keyword option when doing the substring match or it won't do what you are expecting.


-----Original Message-----
From: dhcp-users-bounces at lists.isc.org [mailto:dhcp-users-bounces at lists.isc.org] On Behalf Of Simon Hobson
Sent: Tuesday, April 12, 2016 2:53 AM
To: Users of ISC DHCP
Subject: Re: log statement doesn't

Doug Hughes <doug at will.to> wrote:

> option option125 code 125 = string;
> 
> log (debug, concat("hw: ", binary-to-ascii(16,8,":", hardware)));
> log (debug, concat("client-id: ", binary-to-ascii(16,8,":",substring(dhcp-client
> -identifier,16,1))));
> log (debug, concat("opt-125: ", substring(option125,1,7)));
> log (debug, "check option125");
> 
> The only lines that output anything are the 'hw' line at the beginning and the plain old option125 at the end. The other 2 lines output nothing, not even the plain text.. I wish there was extra levels of debugging that I could turn on to see raw options processing.

Try changing "substring(option125,1,7)" to "pick-first-value(substring(option125,1,7),"")" and see what happens (check the man page to make sure I've got that right). Ditto for client-id.
With concat, if any element is null, then the whole result is null, and so log won't log anything.

_______________________________________________
dhcp-users mailing list
dhcp-users at lists.isc.org
https://lists.isc.org/mailman/listinfo/dhcp-users


More information about the dhcp-users mailing list