Skip to content

Instantly share code, notes, and snippets.

@blakmatrix
Last active December 13, 2015 18:38
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save blakmatrix/4956455 to your computer and use it in GitHub Desktop.
Save blakmatrix/4956455 to your computer and use it in GitHub Desktop.
get last 100 lines from logs nodejitsu
curl -X POST -H "Content-Type: application/json" \
https://api.nodejitsu.com/logs/<username>/<appname> \
-d '{"from":"NOW-1DAY","until":"NOW","rows":100}' \
-u <username>:<password/token> | node -e \
"process.stdin.resume();
process.stdin.setEncoding('utf8');
var str = '';
process.stdin.on('data', function (chunk) {str += chunk.toString();});
process.stdin.on('end', function () {
JSON.parse(str).data.forEach(function(i){process.stdout.write(i.json.message);});});"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment