Skip to content

Commit

Permalink
remove host & pid detail from syslog display (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
msimerson authored Jan 24, 2017
1 parent 748f84c commit bbeb367
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 2 deletions.
5 changes: 5 additions & 0 deletions Changes.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@

1.0.6 - 2017-01-23

* remove host & pid detail from syslog lines

1.0.5 - 2016-11-04

* display log entries for transactions
Expand Down
3 changes: 2 additions & 1 deletion config/log.reader.ini
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

[log]
file=/var/log/haraka.log
file=/var/log/haraka.log
; file=/var/log/maillog
6 changes: 6 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,12 @@ exports.asHtml = function (uuid, matched, done) {
if (transId && transId[1]) replaceString = '[' + transId[1] + '] ';

var trimmed = line.replace(/\[[A-F0-9\-\.]{12,40}\] /, replaceString);

// strip syslog prepended host and PID
if ( / haraka\[[0-9]+\]: /.test(trimmed) ) {
trimmed = trimmed.replace(/(?: [a-z\.\-]+)? haraka\[[0-9]+\]: /, ' ');
}

rawLogs += trimmed + '<br>';
if (/\[karma/.test(line) && /awards/.test(line)) {
lastKarmaLine = line;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "haraka-plugin-log-reader",
"version": "1.0.5",
"version": "1.0.6",
"description": "display log entries from haraka log files via HTTP",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit bbeb367

Please sign in to comment.