<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    You can tailor the log messages to output the subnet type.<br>
    <br>
    Add the two "subnet_type"s (below in your config) and this to
    dhcpd.conf:<br>
    <font color="#993300"><tt>on commit {</tt><tt><br>
      </tt><tt>    log (    info,</tt><tt><br>
      </tt><tt>        concat (</tt><tt><br>
      </tt><tt>            "Subnet-type",    subnet_type,</tt><tt><br>
      </tt><tt>.</tt><tt><br>
      </tt><tt>.</tt><tt><br>
      </tt><tt>        )</tt><tt><br>
      </tt><tt>    );</tt><tt><br>
      </tt><tt>}</tt><tt><br>
      </tt></font><br>
    Then in rsyslog.conf (just after the #### RULES #### line):<br>
    <font color="#993300"><tt>if $programname == 'dhcpd' then {</tt><tt><br>
      </tt><tt>    if $msg contains 'Faculty' then {</tt><tt><br>
      </tt><tt>        action(type="omfile"
        file="/var/log/dhcpd/dhcp-faculty.log")</tt><tt><br>
      </tt><tt>        #  if $syslogseverity >= 4 then stop    #
        warning</tt><tt><br>
      </tt><tt>
                #  if $syslogseverity >= 5 then stop    # notice</tt><tt><br>
      </tt><tt>
                if $syslogseverity >= 6 then stop     # info</tt><tt><br>
      </tt><tt>    }</tt><tt><br>
      </tt><tt>    if $msg contains 'Student' then {</tt><tt><br>
      </tt><tt>        </tt><tt>action(type="omfile"
        file="/var/log/dhcpd/dhcp-student.log")</tt><tt><br>
      </tt><tt>        #  if $syslogseverity >= 4 then stop    #
        warning</tt><tt><br>
      </tt><tt>
                #  if $syslogseverity >= 5 then stop    # notice</tt><tt><br>
      </tt><tt>
                if $syslogseverity >= 6 then stop     # info</tt><tt><br>
      </tt><tt>
            }</tt><tt><br>
      </tt><tt>
        }</tt><tt><br>
      </tt></font><br>
    This should split out the log messages.  Syslog facility 'notice'
    and above still go to<br>
    the regular log file.  Don't forget to restart or reload rsyslogd.<br>
    <br>
    Bill<br>
    <br>
    <div class="moz-cite-prefix">On 6/2/2017 9:11 AM, Fleming, Tony
      wrote:<br>
    </div>
    <blockquote
      cite="mid:71ccbd6722d145d48b3670b0bf75b75d@EXFS01-N8.tcu.edu"
      type="cite">
      <meta http-equiv="Content-Type" content="text/html;
        charset=windows-1252">
      <meta name="Generator" content="Microsoft Word 15 (filtered
        medium)">
      <style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
      <div class="WordSection1">
        <p class="MsoNormal">Can someone point me to a resource or
          provide a configuration example of how to log dhcp transaction
          (request/release/renew…) for each of the defined subnet/pools
          to separate files?<o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal">For example:<o:p></o:p></p>
        <p class="MsoNormal">Shared-network “Faculty”<o:p></o:p></p>
        <p class="MsoNormal">                Subnet 10.10.10.0 netmask
          255.255.255.0 {</p>
      </div>
    </blockquote>
     <font color="#993300"><tt>           set subnet_type = "Faculty";</tt><tt><br>
      </tt></font>
    <blockquote
      cite="mid:71ccbd6722d145d48b3670b0bf75b75d@EXFS01-N8.tcu.edu"
      type="cite">
      <div class="WordSection1">
        <p class="MsoNormal"><font color="#993300"><tt><o:p></o:p></tt></font></p>
        <font color="#993300"><tt>
          </tt></font>
        <p class="MsoNormal">                                Option x<o:p></o:p></p>
        <p class="MsoNormal">                                Option y<o:p></o:p></p>
        <p class="MsoNormal">                                Range…<o:p></o:p></p>
        <p class="MsoNormal">                }<o:p></o:p></p>
        <p class="MsoNormal">Shared-network “Student”<o:p></o:p></p>
        <p class="MsoNormal">                Subnet 10.10.20.0 netmask
          255.255.255.0 {<o:p></o:p></p>
      </div>
    </blockquote>
    <font color="#993300"><tt>            set subnet_type = "Student";</tt><tt><br>
      </tt></font>
    <blockquote
      cite="mid:71ccbd6722d145d48b3670b0bf75b75d@EXFS01-N8.tcu.edu"
      type="cite">
      <div class="WordSection1"><font color="#993300"><tt>
          </tt></font>
        <p class="MsoNormal">                                Option x<o:p></o:p></p>
        <p class="MsoNormal">                                Option y<o:p></o:p></p>
        <p class="MsoNormal">                                Range …<o:p></o:p></p>
        <p class="MsoNormal">                }<o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal">Ideally it would be nice to log these
          transaction to:<o:p></o:p></p>
        <p class="MsoNormal">/var/log/dhcp/dhcp-faculty.log<o:p></o:p></p>
        <p class="MsoNormal">/var/log/dhcp/dhcp-student.log<o:p></o:p></p>
        <p class="MsoNormal">…<o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal">Any pointers are much appreciated!<o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal">Thank you.<o:p></o:p></p>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
dhcp-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:dhcp-users@lists.isc.org">dhcp-users@lists.isc.org</a>
<a class="moz-txt-link-freetext" href="https://lists.isc.org/mailman/listinfo/dhcp-users">https://lists.isc.org/mailman/listinfo/dhcp-users</a></pre>
    </blockquote>
    <br>
  </body>
</html>