Forum Moderators: DixonJones

Message Too Old, No Replies

Concatenating a live log file with an older log file

         

bebox

3:36 pm on Jul 14, 2003 (gmt 0)

10+ Year Member



We have just moved to a new server on the 12th July and we are now using Webalizer to look at our log reports and the log style is the same as it was before out of Apache cause we copied the whole thing over. We also have the past few months log files including the file that holds the rest of July's figures.

My question is can I concatenate the "rest of July log file" with the current live access.log file without having to download the access.log and join them but miss some of the logging while the file is down. I know you can "cat" from the terminal but wasn't sure hwo it worked and how it would work on the live access.log file. I woould just like to get the whole of July's figures in my reports! :))

Thanks for your help...

B

charlier

3:50 pm on Jul 14, 2003 (gmt 0)

10+ Year Member



You can do it but it is probably not a good idea, you really would want to append the 'live' log to the old partial July log and then move that over to be the live log as that would keep the entries in chronological order. This is a bit tricky as you could loose some entries while you doing the cat and you would have to HUP the server (I assume its a 'nix box) after you move the file as Apache caches the file descriptor and does not go by the file name. So it would write to the old file even if you renamed your new file to the live log files name.

A better solution might be to remove the webalizer stats directory and then rerun webalizer to analyze each of your old log files and then the new one. You can 'cat' you old log files to webalizer to run the old ones without modifying your webalizer.conf file. Look at the webalizer documentation for 'standard input'.

hakre

3:52 pm on Jul 14, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



i think the best way is to tell the log program to merge it internally, ie take 2 files to analyze.

bebox

6:24 am on Jul 15, 2003 (gmt 0)

10+ Year Member



Thanks guys...
Charleir - Yep had thought about that as I really didn't want to do the live log thing but couldn;t figure out the webalizer way of reading old file and adding to current data. I was going to delete all the old stuff and start again and as you mentioned the same thing that may be the way to go. Will check out the standard input thing....

Hakre - Yep had tried that but couldn't find out how to do it.....will look harder I think as it must be there somewhere! :))

Thanks again
B