Skip to content

Commit 70dcfc9

Browse files
committed
fixed regex for console logs
1 parent 81bb85f commit 70dcfc9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

dlq_processor/cloudwatchlogs_lambda.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ var includeLogInfo = true; // default is true
1212
// Regex used to detect logs coming from lambda functions.
1313
// The regex will parse out the requestID and strip the timestamp
1414
// Example: 2016-11-10T23:11:54.523Z 108af3bb-a79b-11e6-8bd7-91c363cc05d9 some message
15-
var consoleFormatRegex = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{3}Z\t(\w+?-\w+?-\w+?-\w+?-\w+)\t/;
15+
var consoleFormatRegex = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{3}Z\s(\w+?-\w+?-\w+?-\w+?-\w+)\s/;
1616

1717
// Used to extract RequestID
1818
var requestIdRegex = /(?:RequestId:|Z)\s+([\w\d\-]+)/;
@@ -102,7 +102,7 @@ exports.processLogs = function (env, eventAwslogsData, errorHandler) {
102102
log.message = JSON.parse(log.message);
103103
} catch (err) {
104104
// Do nothing, leave as text
105-
log.message.trim();
105+
log.message = log.message.trim();
106106
}
107107

108108
// delete id as it's not very useful

0 commit comments

Comments
 (0)