Koozali.org: home of the SME Server

limited filtering with viewlog

Michael Herger

limited filtering with viewlog
« on: February 20, 2002, 11:26:08 PM »
Hi!

I often want to filter the logs by date, eg. "Feb 20" to only show today's entries. But as the "viewlogfiles" script does not accept whitespace in a search expression, this is impossible.

May I ask why the search pattern is so limited ("^(\S+)$")? Is this a security feature?!? Wouldn't it be possible to change this?

I know, I can do this right in the script, as I will remove case sensitivity. But these are changes that would soon be lost with an update.

Regards, Michael

koolmoose

Re: limited filtering with viewlog
« Reply #1 on: February 21, 2002, 12:08:54 AM »
Michael Herger wrote:
>
> Hi!
>
> I often want to filter the logs by date, eg. "Feb 20" to only
> show today's entries. But as the "viewlogfiles" script does
> not accept whitespace in a search expression, this is
> impossible.
Hi Michael,
The pattern is Feb 20, I found that using any of the following allowed a limited search on SME 5.1.2

Feb.20  #  . will match any character except line breaks.
Feb\D20 #  \D will match any non-digit
Feb\W20 #  \W will match any non-word character

This should help,
Regards,
Paul

Michael Herger

Re: limited filtering with viewlog
« Reply #2 on: February 21, 2002, 12:48:00 AM »
Ok, this is a solution. But it requires some idea about regular expressions... Thank you anyway!