Current User: Guest Login
Please consider registering

Lost Your Password?

Search Forums:


Minimum search word length is 4 characters – Maximum search word length is 84 characters
Wildcard Usage:
*  matches any number of characters    %  matches exactly one character

apache logs not sorted by timestamp

Reply to Post Add a New Topic

8:31 pm
September 19, 2008



posts 55

Hey all,

So the apache log we get from our proxy webserver seems to have records sorted by their IPs (first field).. I believe AWStats needs the log to be sorted by date (4th field).. I tried running it on the log but it gives me corrupted records only..

Would any1 know how I could sort my log with the timestamp or date field.. ? Will really appreciate..

I found this in some forum but it didnt work for me..

sort -t ' ' -k 4.9,4.12n -k 4.5,4.7M -k 4.2,4.3n -k 4.14,4.15n -k 4.17,4.18n -k 4.20,4.21n

11:52 am
September 21, 2008



posts 1125


Hard to help without knowing more about the log format of your proxy webserver.

You can try your sort command on a sample log file and check if it is sorted in some way or if it is just left unchanged. Please let us know if this helps.

8:31 pm
September 30, 2008



posts 55

hey jean, we stripped many params to make the log format of the proxy webserver to be what Awstats accepts as Log Format= 1 (for Apache)..

fyi for other folks who might run into this issue, when I tried sorting by this, the sort worked !!

sort -t ' ' -k 4.9,4.12n -k 4.5,4.7M -k 4.2,4.3n -k 4.14,4.15n -k 4.17,4.18n -k 4.20,4.21n $1 > $2

Reply to Post

Reply to Topic:
apache logs not sorted by timestamp

Guest Name (Required):

Guest Email (Required):

NOTE: New Posts are subject to administrator approval before being displayed

Confused Cool Cry Embarassed Frown Kiss Laugh Smile Surprised Wink Yell
Post New Reply

Guest URL (required)

Math Required!
What is the sum of:
1 + 9

About the Forum

Forum Timezone: UTC 1

Most Users Ever Online: 302

Currently Online:
19 Guests

Currently Browsing this Topic:
1 Guest

Forum Stats:

Groups: 2
Forums: 9
Topics: 639
Posts: 2710


There are 257 Members
There have been 304 Guests

There is 1 Admin
There is 1 Moderator

Top Posters:

cssfsu – 55
deepakgupta – 34
albert_newton – 30
cosminpana – 20
DTNMike – 19
ahtshun83 – 17

Recent New Members: raju, todd2taylor, sbdcunha, mansigill1987, ThomasDuh, ThomasKic

Administrators: Jean-Luc (1125 Posts)

Moderators: Jean-Luc (1125 Posts)