Apache Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsSystem AdministrationApache Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old November 19th, 2001, 04:58 AM
chakotha chakotha is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2001
Location: Ireland
Posts: 90 chakotha User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 8
Can't open server log file - too big

Hi,

I have recently discovered that our server logs are taking up nearly all of our server space so we have to do something about it.

One of the files is 80MB, 400,000 lines which I have downloaded. Problem is no text editor that I have tried can open it - I wish to delete everything before Oct 2001. ( We use Webalizer for our stats, so I'll save the stats output web page for every month prior to this. ) After that I will try to get log rotation going.

Does any one know how I could open this file? Pico can read it off the server, but I can think of no way to select 350,000+ lines of logs to delete - or 50,000 to keep.

Many thanks.

Reply With Quote
  #2  
Old November 19th, 2001, 05:26 AM
AlCapone's Avatar
AlCapone AlCapone is offline
Mobbing Gangster
Dev Shed Demi-God (4500 - 4999 posts)
 
Join Date: Sep 2001
Location: "Best City" 2002 and 2003- Melbourne, Australia
Posts: 4,913 AlCapone User rank is Sergeant (500 - 2000 Reputation Level)AlCapone User rank is Sergeant (500 - 2000 Reputation Level)AlCapone User rank is Sergeant (500 - 2000 Reputation Level)AlCapone User rank is Sergeant (500 - 2000 Reputation Level)AlCapone User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 5 h 36 m 31 sec
Reputation Power: 18
Send a message via ICQ to AlCapone Send a message via AIM to AlCapone Send a message via Yahoo to AlCapone
I would think ms word can handle such big files.... if not try using php go delete first n lines
BTW, yours was 4000th post in the 'apache' forum, congrats
__________________
And you know I mean that.

Reply With Quote
  #3  
Old November 19th, 2001, 05:50 AM
chakotha chakotha is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2001
Location: Ireland
Posts: 90 chakotha User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 8
Thanks for the reply Al Capone.

MS Word crashes when I try to open the file.
What did you mean by

php go delete first n lines ?

how and where would I run this?

Many Thanks

Reply With Quote
  #4  
Old November 19th, 2001, 01:26 PM
freebsd freebsd is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2001
Posts: 5 freebsd User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Show us several lines of your log so we can see your log format. Anyhow, whatever way you are going to do, you first should rotate your log.

Reply With Quote
  #5  
Old November 20th, 2001, 03:13 AM
chakotha chakotha is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2001
Location: Ireland
Posts: 90 chakotha User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 8
Hi, I got EditPad to open it thanks.

I deleted everything before Nov as we had Incremental Processing running on our stats.

Reply With Quote
  #6  
Old November 30th, 2001, 04:27 AM
romeo romeo is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2001
Posts: 6 romeo User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I have a little solution, but only for unix (linux).
1. wc -l access_log
this will return number of lines in log file
2. grep -n "Oct/2001" aaa|head -1|awk -F: '{ print $1}'
this will return 1st line with "Oct/2001" (format is from Apache access log)
3.calculate a difference between 1st and 2nd value
4. tail -<last value> access_log >part_of_access_log


Reply With Quote
Reply

Viewing: Dev Shed ForumsSystem AdministrationApache Development > Can't open server log file - too big


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway