Skip to content

Commit

Permalink
Merge pull request #409 from nodejitsu/log-filter-app
Browse files Browse the repository at this point in the history
Log filter app
  • Loading branch information
blakmatrix committed Mar 14, 2013
2 parents a35bbd1 + 664ee4e commit 6170ebc
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/jitsu/commands/logs.js
Expand Up @@ -179,6 +179,11 @@ function putLogs (results, appName, amount, showApp) { //TODO: utilize amount an
showApp = args[3] || null;
}

if(appName.indexOf('/') !== -1){
//username = appName.split('/')[0];
appName = appName.split('/')[1];
}

results.data = results.data.filter(function (item) {
return item.json && item.json.hasOwnProperty('message');
});
Expand All @@ -195,7 +200,7 @@ function putLogs (results, appName, amount, showApp) { //TODO: utilize amount an
}

results.data.sort(sort).forEach(function (datum) {
if (datum.json && datum.json.message != null) {
if (datum.json && datum.json.message !== null && datum.json.app !== null && RegExp('^' + appName + '$').test(datum.json.app)) {
// '[' + datum.json.app.magenta + ']
datum.json.message.split('\n').forEach(function (line) {
var now = new Date(datum.timestamp);
Expand Down

0 comments on commit 6170ebc

Please sign in to comment.