I have done similar programs in Perl (you can use PHP also) where, when I read the file in and using regex<div>I select the records that I want to keep.</div><div><br></div><div>Feliz Aņo  :-)<br><br><div class="gmail_quote">
On Fri, Jan 1, 2010 at 9:14 AM, Les Mikesell <span dir="ltr"><<a href="mailto:lesmikesell@gmail.com">lesmikesell@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">ann kok wrote:<br>
> Hi<br>
><br>
> I have apache log file around 7.6G and record half year<br>
><br>
> Which program/command (perl, vi, or sed) is better to extract the data by date? and finally I can remove that big file and still keep the record.<br>
><br>
> I have problem when using vi and it uses up the server memory<br>
><br>
> Thank you for your help<br>
><br>
<br>
</div>If the extraction is simple regex matches you could use sed, but I'd recommend<br>
perl because it has additional features that you might need if the program<br>
becomes more complex and it is easier to write in the first place.<br>
<br>
But first I'd check to see if any of the available log processing programs will<br>
already do what you want.  If you are looking for summaries with counts by<br>
page/time interval/client IP, etc. they may do what you want.  I like analog<br>
because it is very fast and can deal with multiple files even if the times<br>
overlap and can uncompress them on the fly <a href="http://www.analog.cx/" target="_blank">http://www.analog.cx/</a> or download rpm<br>
from <a href="http://www.iddl.vt.edu/~jackie/analog/" target="_blank">http://www.iddl.vt.edu/~jackie/analog/</a>.   Or you might like webalizer if<br>
you just have one server/file.<br>
<font color="#888888"><br>
--<br>
   Les Mikesell<br>
    <a href="mailto:lesmikesell@gmail.com">lesmikesell@gmail.com</a><br>
</font><div><div></div><div class="h5">_______________________________________________<br>
CentOS mailing list<br>
<a href="mailto:CentOS@centos.org">CentOS@centos.org</a><br>
<a href="http://lists.centos.org/mailman/listinfo/centos" target="_blank">http://lists.centos.org/mailman/listinfo/centos</a><br>
</div></div></blockquote></div><br></div>