[fmt] minor fix for the generic_log format and add another pattern to vmw_log

pull/290/head
Timothy Stack 9 years ago
parent feab733742
commit c4ae8d158c

@ -1250,12 +1250,15 @@
},
"pre-5.0" : {
"pattern" : "^\\[(?<timestamp>\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}\\.\\d{3}) (?<tid>\\w+) (?<level>\\w+) '(?<comp>[^']+)'(?: opID=(?<opid>[^ \\]]+))?(?: user=(?<user>[\\w\\-]+))?\\](?<body>.*)(?:\\n(?:.|\\n)*)?$"
},
"ls-log" : {
"pattern" : "^\\[(?<timestamp>\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2},\\d{3}) (?<tid>[\\w\\-]+)\\s+(?<level>\\w+)\\s+(?<comp>[^\\]]+)\\]\\s+(?<body>(?:.|\\n)*)"
}
},
"level-field": "level",
"level" : {
"error" : "(error|panic)",
"warning" : "warning",
"error" : "(error|ERROR|panic|PANIC)",
"warning" : "(warning|WARNING|warn|WARN)",
"trace" : "verbose"
},
"opid-field" : "opid",
@ -1301,6 +1304,9 @@
},
{
"line" : "2014-11-04T12:46:42.990+05:30 Section for VMware VirtualCenter, pid=6432, version=6.0.0, build=2255588, option=BETA"
},
{
"line" : "[2013-01-16 02:26:25,500 pool-3-thread-1 INFO com.vmware.vim.license.service.impl.ServiceImpl] License Accounting Service initialized"
}
]
},

@ -513,10 +513,12 @@ const char *date_time_scanner::scan(const char *time_dest,
if (ptime_f(tm_out, time_dest, off, time_len)) {
tv_out.tv_usec = tm_out->et_nsec / 1000;
this->dts_fmt_len += 7;
retval += 7;
}
else if (ptime_F(tm_out, time_dest, off, time_len)) {
tv_out.tv_usec = tm_out->et_nsec / 1000;
this->dts_fmt_len += 4;
retval += 4;
}
}
}

@ -266,8 +266,8 @@ const char *log_format::log_scanf(const char *line,
pcre_context::capture_t *ts = pc["timestamp"];
for (pcre_context::iterator iter = pc.begin();
iter != pc.end();
++iter) {
iter != pc.end();
++iter) {
pcre_context::capture_t *cap = va_arg(
args, pcre_context::capture_t *);

@ -93,11 +93,11 @@ class generic_log_format : public log_format {
pcre_format("^(?<timestamp>[\\w: \\.,/-]+)\\[[^\\]]+\\](.*)"),
pcre_format("^(?<timestamp>[\\w: \\.,/-]+) (.*)"),
pcre_format("^\\[(?<timestamp>[\\w: \\.+/-]+)\\]\\s*(\\w+):?"),
pcre_format("^\\[(?<timestamp>[\\w: \\.+/-]+)\\] (.*)"),
pcre_format("^\\[(?<timestamp>[\\w: \\.+/-]+)\\] \\[(\\w+)\\]"),
pcre_format("^\\[(?<timestamp>[\\w: \\.+/-]+)\\] \\w+ (.*)"),
pcre_format("^\\[(?<timestamp>[\\w: +/-]+)\\] \\(\\d+\\) (.*)"),
pcre_format("^\\[(?<timestamp>[\\w: \\.,+/-]+)\\]\\s*(\\w+):?"),
pcre_format("^\\[(?<timestamp>[\\w: \\.,+/-]+)\\] (.*)"),
pcre_format("^\\[(?<timestamp>[\\w: \\.,+/-]+)\\] \\[(\\w+)\\]"),
pcre_format("^\\[(?<timestamp>[\\w: \\.,+/-]+)\\] \\w+ (.*)"),
pcre_format("^\\[(?<timestamp>[\\w: ,+/-]+)\\] \\(\\d+\\) (.*)"),
pcre_format()
};

Loading…
Cancel
Save