From owner-freebsd-questions Fri Feb 22 1:55:47 2002 Delivered-To: freebsd-questions@freebsd.org Received: from hotmail.com (f94.law14.hotmail.com [64.4.21.94]) by hub.freebsd.org (Postfix) with ESMTP id BE55237B404 for ; Fri, 22 Feb 2002 01:55:43 -0800 (PST) Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Fri, 22 Feb 2002 01:55:43 -0800 Received: from 194.6.2.163 by lw14fd.law14.hotmail.msn.com with HTTP; Fri, 22 Feb 2002 09:55:42 GMT X-Originating-IP: [194.6.2.163] From: "Alex Dyas" To: freebsd-questions@freebsd.org Subject: Re - Sorting Apache logs by Date and Time Date: Fri, 22 Feb 2002 09:55:42 +0000 Mime-Version: 1.0 Content-Type: text/plain; format=flowed Message-ID: X-OriginalArrivalTime: 22 Feb 2002 09:55:43.0572 (UTC) FILETIME=[17B3C140:01C1BB87] 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 sort -k where n is the space delimeted field you want to sort on. thus to solve your problem : sort -k 4 access_log alex... >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 _________________________________________________________________ Send and receive Hotmail on your mobile device: http://mobile.msn.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message