From: Joshua N Pritikin <jpritikin@pobox.com>
Subject: Re: svlogd pattern documentation
Date: Fri, 9 Dec 2005 23:14:01 +0530 [thread overview]
Message-ID: <20051209174401.GN10371@always.joy.eth.net> (raw)
In-Reply-To: <20051209143713.17200.qmail@20b2cf8d38a761.315fe32.mid.smarden.org>
[-- Attachment #1: Type: text/plain, Size: 1402 bytes --]
OK, here is my suggestion for rewriting the man page:
svlogd matches a log message against a string pattern. The pattern
rules are similar to grep except that svlogd patterns are much simpler
than grep regexp.
= A character not a star (``*'') and not a plus (``+'') matches
itself.
= A plus matches the next character in pattern in the log message one
or more times. For example, the pattern +abc matches aaabc. Note that
with grep, the same pattern would be written as a+bc. svlogd is
different.
= A star before the end of the pattern matches any string in the
log message that does not include the next character in pattern. A
star at the end of pattern matches any string. (In perl terminology,
the svlogd star works like a non-greedy wildcard match .*?.)
An svlogd pattern is not really a regular expression because there is
no backtracking. To see what this means, consider a line like this:
[Fri Dec 09 06:24:23 2005] [error] [client 84.73.105.43] File does not exist: /home/ohl/ohl-v2/htdocs/xmlrpc.php
The following pattern doesn't match:
-*File does not exist*
Why? Because svlogd doesn't backtrack. The star matches up to the
first F in Fri then the match fails because i != r. Once the match
fails, it fails. To match the line, you can use something like the
following pattern instead:
-[*] [*] [*] File does not exist: *
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
prev parent reply other threads:[~2005-12-09 17:44 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-12-09 9:18 Joshua N Pritikin
2005-12-09 14:37 ` Gerrit Pape
2005-12-09 17:44 ` Joshua N Pritikin [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20051209174401.GN10371@always.joy.eth.net \
--to=jpritikin@pobox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).