Anyone got a website?

Have a seat at the fireplace. Free cookies for everyone!
User avatar
Sakura
Resident Kitty
Posts: 2537
Joined: July 9th, 2007, 11:19 pm

Anyone got a website?

Post by Sakura » January 25th, 2009, 1:43 am

And I mean: a real website which is generating standard Unix logfiles.

I just wrote a tool which is taking an unlimited amount of logfiles, reads them all, sorts every line by date/time and then writes the lines back to files using one file per month. I can finally have a look at the logfiles which AAW has created since 2001.

Anyone want to have such a thing?
What do you call a dinosaur with an extended vocabulary? A thesaurus.

User avatar
Zeratul2k
Captain Catnip
Posts: 2261
Joined: July 11th, 2007, 6:10 am
Location: Holding low orbit over All Anime World
Contact:

Re: Anyone got a website?

Post by Zeratul2k » January 25th, 2009, 5:20 am

Oh, neat! Throw it my way, please? I might find a use for it soon enough.
So, Lone Star, now you see that evil will always triumph... because good is DUMB!

User avatar
Sakura
Resident Kitty
Posts: 2537
Joined: July 9th, 2007, 11:19 pm

Re: Anyone got a website?

Post by Sakura » January 25th, 2009, 1:50 pm

My tool has a problem reading files of > 1 GB :pif:
What do you call a dinosaur with an extended vocabulary? A thesaurus.

User avatar
Sakura
Resident Kitty
Posts: 2537
Joined: July 9th, 2007, 11:19 pm

Re: Anyone got a website?

Post by Sakura » January 25th, 2009, 6:47 pm

I'm not 100% happy with my 'tools'. I wrote three tools to help me with archiving, sorting, and editing/cleaning of my old logfiles. One tool is used to concatenate a number of log files. It searches for files and sorts them by file name, then reads every file and concatenate it in one single file. I use ConcatLog for small websites with very little traffic.

Another tool is doing the opposite: It splits up text files in parts for editing and searching. Try opening a 500 megabyte text file with Notepad. Get ready to press and hold then power button. By default it will create files of 100,000 lines each. I use SplitLog to fix illegal entries in logfiles (crashes or hacking attempts)

My masterpiece is SortLog and I'm very proud of it. :love: It counts all files in the current directory starting with 'access' and reads them line by line to find the earliest and latest dates in every logfile. It will determine the oldest date and start reading all files containing log entries for the given month, read all matching lines in memory while eliminating duplicates, sorting them by access time and saving them to single files, then repeating for every month which has entries in any of the logfiles.

So, why I'm not happy... The tool is using windows-1251 encoding for the code page, which is basically Microsoft's version of ANSI code. I'm not sure what happens with international domains. Second, memory usage. I would like to sort the lines for every month which means I have to keep all the lines for a single month in memory. If you have a major website you might run out of memory or have a very poor performance while Windows enlarges your paging file. I'm unsure what crashes your computer first: Me, Windows, or your logfiles? Third, it does some kind of converting to meet the windows-1251 codepage criteria. If you have special chars as arguments it might "work" with them. A possible solution would be, to treat all files as UTF8 and work with Unicode internally. If I understand this Unicode thing correctly this is going to double the amount of memory needed to run the software...

I feel really geekish today. I had pizza and am wearing dirty jeans. There goes whatever is left of my cuteness :swt: :sob:
Attachments
SortLog.zip
Toolpack for large logfiles. Sorry for any german output. No warranty. If you find a problem you may keep it. Keep out of reach from children and/or people with less than 2 GB of RAM.
(508.33 KiB) Downloaded 145 times
What do you call a dinosaur with an extended vocabulary? A thesaurus.

User avatar
Sakura
Resident Kitty
Posts: 2537
Joined: July 9th, 2007, 11:19 pm

Re: Anyone got a website?

Post by Sakura » January 25th, 2009, 7:04 pm

Uhm I forgot to mention the main advantage of my SortLog tool: I can "mix" the logfiles of bbs.allanime.org and www.allanime.org and thus get the traffic calculated for both websites at once.
What do you call a dinosaur with an extended vocabulary? A thesaurus.

User avatar
Hiki
Honorary Evil Kitty
Posts: 2946
Joined: July 10th, 2007, 12:05 pm
Location: ☆Court of Miracles☆
Contact:

Re: Anyone got a website?

Post by Hiki » January 25th, 2009, 7:18 pm

I'm sure you're still very cute! Even with your dirty jeans :thumb:
Don't feed me violins.

User avatar
oldwrench
Ojiichan
Posts: 4042
Joined: July 10th, 2007, 5:35 am
Location: Erehwon MN USA
Contact:

Re: Anyone got a website?

Post by oldwrench » January 25th, 2009, 8:26 pm

Hmmmm, dirty jeans and a pizza, sounds really cute to me. I haven't a clue about your tools, mine are mostly made of steel.
Dogs have owners, Cats have staff

Some mistakes are too much fun to only make once.

User avatar
Sakura
Resident Kitty
Posts: 2537
Joined: July 9th, 2007, 11:19 pm

Re: Anyone got a website?

Post by Sakura » January 26th, 2009, 12:00 am

Perhaps hair and slide...
What do you call a dinosaur with an extended vocabulary? A thesaurus.

Dechant
Dedicated Fan
Dedicated Fan
Posts: 150
Joined: August 4th, 2007, 10:23 am

Re: Anyone got a website?

Post by Dechant » January 26th, 2009, 3:58 am

I don't like girls in dirty jeans, not cute at all; I'd get rid of these evil dirty clothes instantly. But that's probably not the topic here. :shy:

User avatar
Sakura
Resident Kitty
Posts: 2537
Joined: July 9th, 2007, 11:19 pm

Re: Anyone got a website?

Post by Sakura » January 26th, 2009, 9:25 am

I only have two jeans and I just did my laundry so there is a good chance I'm not wearing one this week.

Anyone tried my tool(s)?
What do you call a dinosaur with an extended vocabulary? A thesaurus.

Post Reply