[ale] extract lines from a log between a specified start and stop time?

Bob Toxen bob at verysecurelinux.com
Wed Feb 25 19:19:34 EST 2004


On Wed, Feb 25, 2004 at 04:01:14PM -0500, Fletch wrote:
> >>>>> "Robert" == Robert H Gibson <Gibson> writes:

>     Robert> Has anyone seen or written a script that will extract the
>     Robert> lines from a log between a specified start and stop
>     Robert> time/string?

> perl -lne 'print if /start/../end/' foo
Looks like the optimum solution.

One could use awk or sed if one wanted to be old fashioned.

>      Replace `start' and `end' to taste (minding any regex
> metacharacters, of course).
> -- 
> Fletch                | "If you find my answers frightening,       __`'/|
> fletch at phydeaux.org   |  Vincent, you should cease askin'          \ o.O'
>                       |  scary questions." -- Jules                =(___)=
>                       |                                               U

Bob Toxen
bob at verysecurelinux.com               [Please use for email to me]
http://www.verysecurelinux.com        [Network&Linux/Unix security consulting]
http://www.realworldlinuxsecurity.com [My book:"Real World Linux Security 2/e"]
Quality Linux & UNIX security and SysAdmin & software consulting since 1990.

"Microsoft: Unsafe at any clock speed!"
   -- Bob Toxen 10/03/2002



More information about the Ale mailing list