<html><body><div style="font-family: Andale Mono; font-size: 10pt; color: #000000"><div style="font-family: Andale Mono; font-size: 10pt; color: #000000">What version of ISC DHCP, and is this DHCPv6 that you are trying to log?<br><br><hr id="zwchr" data-marker="__DIVIDER__"><div data-marker="__HEADERS__"><blockquote style="border-left:2px solid #1010FF;margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;"><b>From: </b>"Sean McMurray" <sean@mvtel.com><br><b>To: </b>"Users of ISC DHCP" <dhcp-users@lists.isc.org><br><b>Sent: </b>Tuesday, March 17, 2015 9:22:30 PM<br><b>Subject: </b>Re: Logging circuit-id<br></blockquote></div><div data-marker="__QUOTED_TEXT__"><blockquote style="border-left:2px solid #1010FF;margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;">I can tell it to log(error, "Hello") and it won't log.<br>
<br>
<div class="moz-cite-prefix">On 03/17/2015 06:15 PM, perl-list
wrote:<br>
</div>
<blockquote cite="mid:1439414469.684071.1426641340236.JavaMail.zimbra@network1.net">
<div style="font-family: Andale Mono; font-size: 10pt; color:
#000000">
<div style="font-family: Andale Mono; font-size: 10pt; color:
#000000"><br>
</div>
<div style="font-family: Andale Mono; font-size: 10pt; color:
#000000">Here is an example of how I have done it:</div>
<div style="font-family: Andale Mono; font-size: 10pt; color:
#000000"><br>
</div>
<div style="font-family: Andale Mono; font-size: 10pt; color:
#000000">
<p style="margin: 0px; font-size: 11px; font-family: Menlo;">if exists agent.circuit-id {</p>
<p style="margin: 0px; font-size: 11px; font-family: Menlo;"> log ( error,</p>
<p style="margin: 0px; font-size: 11px; font-family: Menlo;"> concat( "agent.circuit-id,",
binary-to-ascii (10, 8, ".", leased-address),",",</p>
<p style="margin: 0px; font-size: 11px; font-family: Menlo;"> "circuit-id,",option
agent.circuit-id,",",</p>
<p style="margin: 0px; font-size: 11px; font-family: Menlo;">
"time,",binary-to-ascii(10,32,"",encode-int
(lease-time,32)),",",</p>
<p style="margin: 0px; font-size: 11px; font-family: Menlo;">
"hardware,",binary-to-ascii(16,8,":",substring(hardware,1,7))</p>
<p style="margin: 0px; font-size: 11px; font-family: Menlo;"> )</p>
<p style="margin: 0px; font-size: 11px; font-family: Menlo;"> );</p>
<p style="margin: 0px; font-size: 11px; font-family: Menlo;">}</p>
<div><br>
</div>
</div>
<div style="font-family: Andale Mono; font-size: 10pt; color:
#000000">If that doesn't work then the circuit-id may not be
there (if no line appears at all in the logs), or if it only
logs a partial line then the circuit-id is likely binary
instead of ASCII. I'm not sure how to log if it is binary -
some use of binary-to-ascii will be necessary.<br>
<br>
<hr id="zwchr">
<div>
<blockquote style="border-left:2px solid
#1010FF;margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;"><b>From:
</b>"Sean McMurray" <a class="moz-txt-link-rfc2396E" href="mailto:sean@mvtel.com" target="_blank"><sean@mvtel.com></a><br>
<b>To: </b><a class="moz-txt-link-abbreviated" href="mailto:dhcp-users@lists.isc.org" target="_blank">dhcp-users@lists.isc.org</a><br>
<b>Sent: </b>Tuesday, March 17, 2015 5:51:16 PM<br>
<b>Subject: </b>Logging circuit-id<br>
</blockquote>
</div>
<div>
<blockquote style="border-left:2px solid
#1010FF;margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;">I
would like my dhcpd logs to include circuit-id.<br>
I have tried to use log() directives in my conf file, but
nothing I have <br>
tried works.<br>
<br>
Here is an example of a configuration I have included in a
subnet:<br>
<br>
log(info, concat(<br>
" Mac: ",binary-to-ascii(16, 8, ":",
substring(hardware,1, 6))<br>
," IP: ",binary-to-ascii (10, 8, ".", leased-address)<br>
,"Circuit: ",option agent.circuit-id<br>
));<br>
<br>
<br>
Standard logging is working fine to record DHCPDISCOVER,
DHCPOFFER, etc. <br>
I just can't get custom entries to show up in the log.<br>
<br>
_______________________________________________<br>
dhcp-users mailing list<br>
<a class="moz-txt-link-abbreviated" href="mailto:dhcp-users@lists.isc.org" target="_blank">dhcp-users@lists.isc.org</a><br>
<a class="moz-txt-link-freetext" href="https://lists.isc.org/mailman/listinfo/dhcp-users" target="_blank">https://lists.isc.org/mailman/listinfo/dhcp-users</a></blockquote>
</div>
</div>
<br>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre>_______________________________________________
dhcp-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:dhcp-users@lists.isc.org" target="_blank">dhcp-users@lists.isc.org</a>
<a class="moz-txt-link-freetext" href="https://lists.isc.org/mailman/listinfo/dhcp-users" target="_blank">https://lists.isc.org/mailman/listinfo/dhcp-users</a></pre>
</blockquote>
<br>
<br>_______________________________________________<br>dhcp-users mailing list<br>dhcp-users@lists.isc.org<br>https://lists.isc.org/mailman/listinfo/dhcp-users</blockquote></div></div><br></div></body></html>