Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Parse apache error_log
- X-seq: zsh-users 20175
- From: Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Re: Parse apache error_log
- Date: Fri, 1 May 2015 22:03:11 +0100
- In-reply-to: <XnsA48DA9D8816E2davidrayninfocouk@80.91.229.13>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <XnsA48DA9D8816E2davidrayninfocouk@80.91.229.13>
On Fri, 1 May 2015 15:41:37 +0000 (UTC)
zzapper <david@xxxxxxxxxxxxxx> wrote:
> Don't know if this is a job for zsh or sed etc
>
> Format:-
> [Fri May 01 16:25:05 2015] [error] [client 172.18.158.61] PHP Parse error:
> syntax error, unexpected T_VARIABLE
>
> I want to grab the date-time of the last entry and then display all the
> entries with the same date-time.
Well, you *could* do this...
log=wherever
fgrep -h "$(tail -1 $log | sed 's/^\[\([^]]*\)\].*/\1/')" $log
pws
Messages sorted by:
Reverse Date,
Date,
Thread,
Author