Paul Chvostek wrote:
This is an attempt to isolate every MAC address that
appears and then sort and count them to see who is having
trouble or, in some cases, is causing trouble.
Then you still may want to use awk for some of that...
cat /var/log/dhcpd.log | \
sed -nE
On Tue, 2008-08-26 at 22:12 -0500, 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:
sed 's/.*\([[ your regular expression ]]\).*/\1/'
The \1 tells sed to only
My thanks to several people who have provided great suggestions
and an apology for not being clear on the log data I am mining
for MAC addresses. It is syslog and a typical line looks like:
Aug 26 20:45:36 dh1 dhcpd: DHCPACK on 10.198.67.116 to 00:12:f0:88:97:d6
(peaster-laptop) via 10.198.71.246
On Wednesday 27 August 2008 15:25:02 Martin McCormick wrote:
The sed pattern matching system is interesting because I
can think of several similar situations in which the data are
there but there is no guarantee where on a given line it sits
and grep or sed usually will pull in the
On Wed, 2008-08-27 at 08:25 -0500, Martin McCormick wrote:
My thanks to several people who have provided great suggestions
and an apology for not being clear on the log data I am mining
for MAC addresses. It is syslog and a typical line looks like:
Aug 26 20:45:36 dh1 dhcpd: DHCPACK on
Hi Martin.
On Wed, Aug 27, 2008 at 08:25:02AM -0500, Martin McCormick wrote:
Aug 26 20:45:36 dh1 dhcpd: DHCPACK on 10.198.67.116 to 00:12:f0:88:97:d6
(peaster-laptop) via 10.198.71.246
That was one line broken to aid in emailing, but that's what
types of lines are involved. The MAC
Paul Chvostek writes:
While I agree with others that awk should be used with explicit
recognition of the particular lines, you can still snatch everything
with sed if you want to. In FreeBSD, sed supported extended regex, so:
sed -nE 's/.*([0-9a-f]{2}(:[0-9a-f]{2}){5}).*/\1/p'
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:
sed 's/.*\([[ your regular expression ]]\).*/\1/'
The \1 tells sed to only print what matched and skip all the rest.
I am doing
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:
sed 's/.*\([[ your regular expression ]]\).*/\1/'
The \1 tells sed to only print what matched and skip all the
On Tue, Aug 26, 2008, 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:
sed 's/.*\([[ your regular expression ]]\).*/\1/'
The \1 tells sed to only print what matched
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
Parv writes:
For even finer results, use word boundaries ...
egrep '\bIN[^[:alnum:]]+A\b' file
egrep '\IN[[:space:]]+A\' file
I sincerely thank all for your examples which I have saved for
future reference. The word boundary test appears to work perfectly,
but after looking at all
After reading a bit about extended regular expressions and
having a few actually work correctly in sed scripts, I tried one in
egrep and it isn't working although there are no errors.
I was hoping to get only the A records from a dns zone file so
the expression I used is:
egrep
On 12/10/05, Martin McCormick [EMAIL PROTECTED] wrote:
After reading a bit about extended regular expressions and
having a few actually work correctly in sed scripts, I tried one in
egrep and it isn't working although there are no errors.
I was hoping to get only the A
At 02:12 PM 12/9/2005, Martin McCormick wrote:
After reading a bit about extended regular expressions and
having a few actually work correctly in sed scripts, I tried one in
egrep and it isn't working although there are no errors.
I was hoping to get only the A records from a
in message [EMAIL PROTECTED],
wrote Glenn Dawson thusly...
At 02:12 PM 12/9/2005, Martin McCormick wrote:
I was hoping to get only the A records from a dns zone file so
the expression I used is:
egrep [[:space:]IN[:space:]A[:space:]] zone_file h0
Had it worked, all that
Martin McCormick wrote:
After reading a bit about extended regular expressions and
having a few actually work correctly in sed scripts, I tried one in
egrep and it isn't working although there are no errors.
I was hoping to get only the A records from a dns zone file so
the expression I
17 matches
Mail list logo