Huge log files won’t go away and since my last posting, I found a few different ways to get through them, some of which are better solutions than what I posted before.

First solution doesn’t really apply if you don’t have access to a Linux system or SSH access to your web server.  Since I have SSH access, this comes in handy to me.

Generally, SSH into the server (well, my server) and you can get at the logs pretty nicely.  The only problem is that the large files for the month are in gz format.  However, zcat will cat those files for you, cat meaning that the file is written to the display and thus can be searched by grep.  Below is an example of how to use that command.

zcat file.gz | grep SearchString

However, I have other files to read, on servers without SSH, and the files are not in gz format.  So thus the files are downloaded to my Windows 7 machine and I have to look at them there.

A solution I tried is Powershell.  All I can say about me looking around is that the Powershell version of grep (which is not mapped to grep) is painfully slow, slow enough to not even mention.

In the prior entry I posted in this blog, I mentioned Cygwin, which would work… but right now Cygwin isn’t ready for Windows 7 and their website is down.  Besides, I don’t need this whole environment, I just need the utilities cat, grep, and tail if that…  Windows has the pipe commands down, just not the rest of everything.

Well, somebody just ported those Unix utilities.  I’m glad to say that they work well.  Mainly, download the zip file with “all the utilities” and in that file go to the usr\local\wbin\ directory and then grab the files you need, mainly grep.exe, cat.exe, and tail.exe.  You can put them in a directory for calling up.

Run the appropriate commands, and enjoy another way of going through huge log files.

cat.exe games_mp.log | grep.exe “say” > says.txt

Unlike Cygwin, you won’t get “up to date” versions of these files.  They seem to be somewhat old, but functional.  Also, I don’t think they will assist you much if you do much more with Unix commands than the minor searches I’m doing.  Still, that being said, I think this solution works best for me at this point.

You can find these “Unix utilities” below.

http://sourceforge.net/projects/unxutils/

Anyways, certainly glad I found yet another way to tackle these huge files.