kernel_log_collector.sh : correct kernel message pattern
The timestamp in the kernel message can have either "+" or "-"
sign. We want to match both of them.
BUG=chromium:226186
TEST=Make sure the script can capture message starting with
"2013-06-19T20:38:58.663410+00:00 localhost kernel: ["
Change-Id: I93647d4fc8b3d796166d2e959b24364de4bc60c5
Reviewed-on: https://gerrit.chromium.org/gerrit/59297
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Queue: Yufeng Shen <miletus@chromium.org>
Tested-by: Yufeng Shen <miletus@chromium.org>
diff --git a/crash_reporter/kernel_log_collector.sh b/crash_reporter/kernel_log_collector.sh
index a9d4307..d38479e 100644
--- a/crash_reporter/kernel_log_collector.sh
+++ b/crash_reporter/kernel_log_collector.sh
@@ -9,12 +9,13 @@
# And only those logs which are within the last YYY seconds of the latest log
# that has the keyword XXX are printed.
-# Kernel log has the format
+# Kernel log has the possible formats:
# 2013-06-14T16:31:40.514513-07:00 localhost kernel: [ 2.682472] MSG MSG ...
+# 2013-06-19T20:38:58.661826+00:00 localhost kernel: [ 1.668092] MSG MSG ...
search_key=$1
time_duration=$2
-msg_pattern="^[0-9-]*T[0-9:.-]* localhost kernel"
+msg_pattern="^[0-9-]*T[0-9:.+-]* localhost kernel"
die() {
echo "kernel_log_collector: $*" >&2