[syslog-ng] escaping \[ not respected
Evan Rempel
erempel at uvic.ca
Thu Oct 2 17:51:23 CEST 2008
Balazs Scheidler wrote:
> On Thu, 2008-10-02 at 09:12 +1300, chris packham wrote:
>> One option would be to use the kind quotes ' vs " to determine whether to
>> escape or not. I believe bash (and maybe perl) does this kind of thing when
>> handling strings.
>
> Yeah, the problem is with compatibility, ' and " style quoting has been
> working this way for about a decade, changing that would break a lot of
> configurations.
>
> I should have made this decision back then, but changing this now is not
> really possible I think.
Perhaps adding a new config keyword
match_pcre(/no syslog-ng escape codes, all escapes are handled by the pcre evaluation/)
The down side to this is that you really need to have program_pcre and any other additions along those
lines. Things get a little messy. Hopefully in a later version the normal match, program directives could be
made to work this way, and the match_pcre etc would become backwards compatible aliases to the non_pcre commands.
I don't really like that solution, but I thought I would "throw it out there".
Another option is to an something like is already present for the templates where there is a
template_escape(no) option. If you add a regex_escape(yes/no) directive and default to yes, then
all of the current expressions would work.
If you do not need to have quotes in your expression, then you can use regex_escape(no) and do
away with the escapes for the escapes.
Just a couple of thoughts.
--
Evan Rempel
More information about the syslog-ng
mailing list