From 94459f2cb1b9b1beac365b2769e230be74b8afb5 Mon Sep 17 00:00:00 2001 From: Timothy Stack Date: Fri, 1 May 2015 20:52:00 -0700 Subject: [PATCH] [generic_log] fix log levels for generic_log --- src/default-log-formats.json | 17 ++++++++++++----- src/log_format.cc | 2 +- test/Makefile.am | 1 + test/logfile_generic.1 | 2 ++ test/test_logfile.sh | 7 +++++++ 5 files changed, 23 insertions(+), 6 deletions(-) create mode 100644 test/logfile_generic.1 diff --git a/src/default-log-formats.json b/src/default-log-formats.json index 50f8411f..d1e1f31b 100644 --- a/src/default-log-formats.json +++ b/src/default-log-formats.json @@ -70,6 +70,8 @@ }, "rbd_log" : { "title" : "VMware vSphere Auto Deploy log format", + "description" : "The log format for the VMware Auto Deploy service", + "url" : "http://kb.vmware.com/kb/2000988", "regex" : { "std" : { "pattern" : "^(?\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(?:\\.\\d{3})?) \\[(?\\d+)\\](?\\w+):(?\\w+):(?.*$)" @@ -86,7 +88,8 @@ "value" : { "pid" : { "kind" : "integer", - "identifier" : true + "identifier" : true, + "foreign-key" : true }, "module" : { "kind" : "string", @@ -438,7 +441,8 @@ }, "job_id" : { "kind" : "integer", - "identifier" : true + "identifier" : true, + "foreign-key" : true }, "page_number" : { "kind" : "string" @@ -551,7 +555,8 @@ "kind" : "string" }, "rc" : { - "kind" : "integer" + "kind" : "integer", + "foreign-key" : true }, "duration" : { "kind" : "float" @@ -834,11 +839,13 @@ "value": { "cpu": { "kind": "integer", - "identifier": true + "identifier": true, + "foreign-key" : true }, "world_id": { "kind": "integer", - "identifier": true + "identifier": true, + "foreign-key" : true }, "subsystem": { "kind": "string", diff --git a/src/log_format.cc b/src/log_format.cc index 183fc7bd..9690b46f 100644 --- a/src/log_format.cc +++ b/src/log_format.cc @@ -82,7 +82,7 @@ const char *logline::level_names[LEVEL__MAX + 1] = { }; static pcrepp LEVEL_RE( - "^(?i)(TRACE|DEBUG\\d*|INFO|STATS|WARN(?:ING)?|ERROR|CRITICAL|SEVERE|FATAL)$"); + "(?i)(TRACE|DEBUG\\d*|INFO|STATS|WARN(?:ING)?|ERROR|CRITICAL|SEVERE|FATAL)"); logline::level_t logline::string2level(const char *levelstr, ssize_t len, bool exact) { diff --git a/test/Makefile.am b/test/Makefile.am index 8a9a64c5..bc5f6290 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -220,6 +220,7 @@ dist_noinst_DATA = \ logfile_filter.0 \ logfile_for_join.0 \ logfile_generic.0 \ + logfile_generic.1 \ logfile_glog.0 \ logfile_json.json \ logfile_multiline.0 \ diff --git a/test/logfile_generic.1 b/test/logfile_generic.1 new file mode 100644 index 00000000..173c027b --- /dev/null +++ b/test/logfile_generic.1 @@ -0,0 +1,2 @@ +2015-04-24T21:09:29.296 25376]INFO:somemodule:Something very INFOrmative. +2015-04-24T21:09:39.296 25376]ERROR:somemodule:Something very INFOrmative. diff --git a/test/test_logfile.sh b/test/test_logfile.sh index cd4355b5..df361aee 100644 --- a/test/test_logfile.sh +++ b/test/test_logfile.sh @@ -177,6 +177,13 @@ check_output "generic_log level interpreted incorrectly?" <