[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]
Re: Off Topic: Using GREP to strip out information from a log file???
- From: Ahbaid Gaffoor <ahbaidg guyana net gy>
- To: redhat-list redhat com
- Subject: Re: Off Topic: Using GREP to strip out information from a log file???
- Date: Fri, 09 Apr 1999 00:34:59 -0500
Hi George,
sure you can...
if your old log file is say oldlog.txt and your internal IP address are
192.168.x.x
the following command gets all data BUT the internal IP addresses and places it
in a new file selected.txt
cat oldlog.txt | grep -v "192.168" > selected.txt
regards,
Ahbaid.
George Lenzer wrote:
> Hello,
>
> I have some web server logs that have been keeping track of hits to our site
> from within our networkk AND outside. I reconfigured our web server to only
> keep track of outside hits since we are gathering stats for outside use.
> However, I need to go back to some of our older logs and redo the stats
> without the inside hits. Since each line of the log file starts with the IP
> address of the machine accessing the site, I thought it may be possible to
> strip out the lines with internal IP addresses. Our internal range always
> starts with 192.168 Could I use 'grep' and maybe 'cat' to copy out the data
> from the logs to a new file without the lines that start with our internal
> address range? I'm sure it can be done, but I am not sure of the mechanics
> behind it. Any suggestions would be very appreciated.
>
> Thanks,
> G. Lenzer
>
> --
> PLEASE read the Red Hat FAQ, Tips, Errata and the MAILING LIST ARCHIVES!
> http://www.redhat.com http://archive.redhat.com
> To unsubscribe: mail redhat-list-request redhat com with
> "unsubscribe" as the Subject.
[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]