From owner-freebsd-questions Thu Feb 21 10: 9:55 2002 Delivered-To: freebsd-questions@freebsd.org Received: from mail004.syd.optusnet.com.au (mail004.syd.optusnet.com.au [203.2.75.228]) by hub.freebsd.org (Postfix) with ESMTP id 1F1A537B42A for ; Thu, 21 Feb 2002 10:09:47 -0800 (PST) Received: from gandalf.scott.sh (c26153.sunsh1.vic.optusnet.com.au [203.164.241.159]) by mail004.syd.optusnet.com.au (8.11.1/8.11.1) with SMTP id g1LI9kU30731 for ; Fri, 22 Feb 2002 05:09:46 +1100 Received: (from scotia_mail@localhost) by gandalf.scott.sh (8.11.6/8.11.6) id g1LI9e343485 for freebsd-questions@FreeBSD.ORG; Fri, 22 Feb 2002 05:09:40 +1100 (EST) (envelope-from scotia_mail) Date: Fri, 22 Feb 2002 05:09:40 +1100 From: Scott Aitken To: freebsd-questions@FreeBSD.ORG Subject: Sorting Apache logs by Date and Time Message-ID: <20020222050939.A43475@gandalf.scott.sh> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Hi All, is there a quick way to sort apache logs by the date and time field if the format is the following: 146.101.149.65 - - [22/Feb/2002:04:18:54 +1100] "GET /images/test.png HTTP/1.0" 200 381 "http://www-redirect.scott.sh:8080/cgi-bin/fred.pl" "Mozilla/4.0 (compatible; MSIE 5.5; Windows 98)" This is a sample line. I have found difficulty in using the sort utility because of the textual month names, as well as the fact that the separators are both slashes and colons. Regards and TIA, Scott Aitken To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message