From 244ee2717f0bb8ec99facbfb6d989a39ecaf27bb Mon Sep 17 00:00:00 2001 From: Timothy Stack Date: Fri, 7 Nov 2014 06:16:45 -0800 Subject: [PATCH] [vmw_log] fix full message read for continued messages --- src/data_scanner.cc | 4 ++-- src/default-log-formats.json | 8 ++++---- src/logfile.hh | 4 +++- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/data_scanner.cc b/src/data_scanner.cc index a3b736cd..8b44e892 100644 --- a/src/data_scanner.cc +++ b/src/data_scanner.cc @@ -63,9 +63,9 @@ static struct { { "hexd", pcrepp( "\\A([0-9a-fA-F][0-9a-fA-F](?::[0-9a-fA-F][0-9a-fA-F])+)"), }, - { "coln", pcrepp("\\A(:)"), + { "coln", pcrepp("\\A(:)"), }, - { "eq", pcrepp("\\A(=)"), + { "eq", pcrepp("\\A(=)"), }, { "comm", pcrepp("\\A(,)"), }, diff --git a/src/default-log-formats.json b/src/default-log-formats.json index 6001322a..e1e19610 100644 --- a/src/default-log-formats.json +++ b/src/default-log-formats.json @@ -669,13 +669,13 @@ "url" : "http://kb.vmware.com/kb/2004201", "regex" : { "6.0+" : { - "pattern" : "^(?\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}(?:Z|[-+]\\d{2}:\\d{2})) (?:Section for VMware VirtualCenter,.*|(?\\w+) (?\\w+)\\[(?\\w+)\\] \\[(?[^ \\]]+)\\s*(?: sub=(?[^ \\]]+))?(?: opID=(?[^ \\]]+))?(?: user=(?[\\w\\-]+))?\\](?(?:.|\\n)*))$" + "pattern" : "^(?\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}(?:Z|[-+]\\d{2}:\\d{2})) (?:Section for VMware VirtualCenter,.*|(?\\w+) (?\\w+)\\[(?\\w+)\\] \\[(?[^ \\]]+)\\s*(?: sub=(?[^ \\]]+))?(?: opID=(?[^ \\]]+))?(?: user=(?[\\w\\-]+))?\\](?.*)(?:\\n(?:.|\\n)*)?)$" }, "5.0+" : { - "pattern" : "^(?\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}(?:Z|[-+]\\d{2}:\\d{2})) \\[(?\\w+) (?\\w+) '(?[^']+)'(?: opID=(?[^ \\]]+))?(?: user=(?[\\w\\-]+))?\\](?(?:.|\\n)*)$" + "pattern" : "^(?\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}(?:Z|[-+]\\d{2}:\\d{2})) \\[(?\\w+) (?\\w+) '(?[^']+)'(?: opID=(?[^ \\]]+))?(?: user=(?[\\w\\-]+))?\\](?.*)(?:\\n(?:.|\\n)*)?$" }, "pre-5.0" : { - "pattern" : "^\\[(?\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}\\.\\d{3}) (?\\w+) (?\\w+) '(?[^']+)'(?: opID=(?[^ \\]]+))?(?: user=(?[\\w\\-]+))?\\](?(?:.|\\n)*)$" + "pattern" : "^\\[(?\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}\\.\\d{3}) (?\\w+) (?\\w+) '(?[^']+)'(?: opID=(?[^ \\]]+))?(?: user=(?[\\w\\-]+))?\\](?.*)(?:\\n(?:.|\\n)*)?$" } }, "level-field": "level", @@ -719,7 +719,7 @@ "line" : "[2011-04-01 15:14:34.203 F5A5AB90 info 'vm:/vmfs/volumes/4d6579ec-23f981cb-465c-00237da0cfee/Vmotion-test/Vmotion-test.vmx' opID=F6FC49D5-000007E6-d] VMotionPrepare: dstMgmtIp=10.21.49.138" }, { - "line" : "2014-11-04T15:53:31.075+05:30 verbose vpxd[05160] [Originator@6876 sub=PropertyProvider opID=ProcessAlarmFiring-427c3c55] RecordOp ASSIGN: declaredAlarmState[\"alarm-1.host-23\"], host-23. Applied change to temp map.\nfoo" + "line" : "2014-11-04T15:53:31.075+05:30 verbose vpxd[05160] [Originator@6876 sub=PropertyProvider opID=ProcessAlarmFiring-427c3c55] RecordOp ASSIGN: declaredAlarmState[\"alarm-1.host-23\"], host-23. Applied change to temp map." }, { "line" : "2014-01-17T04:55:50.347Z [7F03ECE76700 verbose 'Default' opID=2140bc71] [VpxVmomi] Invoke done: vmodl.query.PropertyCollector.waitForUpdatesEx session: c580b3ef-0011-88a5-b2af-7ca7e74114c8" diff --git a/src/logfile.hh b/src/logfile.hh index 5bf89cd3..789c68c7 100644 --- a/src/logfile.hh +++ b/src/logfile.hh @@ -250,7 +250,9 @@ public: do { ++next_line; - } while (next_line != this->end() && ll->get_offset() == next_line->get_offset()); + } while ((next_line != this->end()) && + ((ll->get_offset() == next_line->get_offset()) || + next_line->is_continued())); if (next_line == this->end()) { retval = this->lf_index_size - ll->get_offset();