At 2008-08-26T22:12:19-05:00, Martin McCormick wrote:

> I am trying to isolate only the MAC addresses that appear in
> dhcpd logs.
> For anyone who is interested, the sed construct that should do
> this looks like:

It'd be better if you post a few relevant lines of the log file.
Pending that, I suggest awk(1) in case the log file format is similar
to the following snippet of `dhcpd.leases' on an OpenBSD server:

% cat dhcpd.leases
lease 192.168.10.216 {
  starts 3 2008/07/16 23:17:29;
  ends 4 2008/07/17 00:17:29;
  tstp 4 2008/07/17 00:17:29;
  binding state free;
  hardware ethernet 00:1f:c6:81:66:a6;
}
lease 192.168.10.65 {
  starts 4 2008/07/17 11:15:48;
  ends 5 2008/07/18 11:15:48;
  tstp 5 2008/07/18 11:15:48;
  binding state free;
  hardware ethernet 00:16:d3:9e:eb:74;
}

% awk '/hardware ethernet/ { print substr($3, 4, 14) }' dhcpd.leases
1f:c6:81:66:a6
16:d3:9e:eb:74

Raghavendra.

-- 
N. Raghavendra <[EMAIL PROTECTED]> | http://www.retrotexts.net/
Harish-Chandra Research Institute   | http://www.mri.ernet.in/
See message headers for contact and OpenPGP information.

_______________________________________________
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to