I have the following regexp:


and a line from the log that I am trying to parse (there are some spaces at the beginning of the line):

 13:33:00.1205 [-] Persisting VDOM path /

trying to process a file using pm_pattern module with LogLevel DEBUG this is what I get:

2016-11-16 13:38:00 DEBUG regexp '^\s*(\d{2}:\d{2}:\d{2}\.\d{4})\s+(\[S+\])s+([\s\S]*)$' did not match against '  13:38:00.1857 [-] Persisting VDOM path /'

Part of the xml file used to process the input:

    <description>Regular log line</description>

What is wrong with my expression? 


AskedNovember 16, 2016 - 11:17am

Answer (1)

This one works:


Of course it is a better one overall, however none of the online regular expression tools (regexr.com or others) do not complain on the original one. Maybe it would be beneficial to somehow document regular expression dialect used in nxlog?



Comments (1)

  • b0ti's picture

    NXLog uses the pcre engine for regular expressions. Most online regexp checkers use Javascript so there are some differences.

    Note that your regexp has the following:


    I believe this should be \S+