[syslog-ng] Solving parsing problem

ILLES Marton illes.marton at balabit.hu
Fri Sep 3 18:50:45 CEST 2010


On Thu, 2010-09-02 at 10:31 -0700, Matthew Hall wrote:
> On Thu, Sep 02, 2010 at 01:12:40PM +0000, otgovorete at gmail.com wrote:
> > The parser i've made parses successfully A but not B. The problem is
> > extra whitespace when the date is one digit. I am testing parsing
> > with pdbtool of syslog-ng.
> 
> I have this problem pretty often myself unfortunately. If you just want 
> to get it to work ASAP even if it's not the most elegant situation, just 
> add @ANYSTRING::@ to the end of your parser, right after the last non 
> whitespace character of the message and it will "eat up" the trailing 
> chars to successfully process the string.
> 
> > Please, advice me how to proceed. Thank you.
> 
> Hope this will help you out.

Hi,

Actually  you do not have to use ANYSTRING for matching as the parses
does a longest prefix search. ANYSTRING is useful only in cases when you
want to store the rest of the message in a variable for accessing it
latter. Normally you can simply end you pattern and it should match.

BR,
Marton





More information about the syslog-ng mailing list