[syslog-ng] Regex subpattern macros [1.9.9]

Mel Collins mel.collins at monstermob.com
Wed Mar 8 12:40:39 CET 2006


On Tuesday 07 Mar 2006 18:18, Mel Collins wrote:
>  I'm using syslog-ng's match filter to extract parts of messages for use in
> parts of the destination; specifically in the log file name and template
> sections.

 I've just been going through the source, and it's been a long while since I 
last used C, but I think I can answer my own question:

>  It seems to me like the subpattern macros - $1, $2, etc - aren't
> maintained on a per-message basis, but are global..?

 Yes, the subpattern matches are stored globally, in the array re_matches 
(defined in filter.c/h, used in macros.c). I can't think of any logical 
reason why it would be designed this way intentionally, so I suspect it's an 
oversight/bug. Unless there's something I've missed?

 Is there any official way to report bugs, or is this as official as it 
gets? ;)

 Takk,
 - Mel C


More information about the syslog-ng mailing list