Last active
December 13, 2015 18:38
-
-
Save blakmatrix/4956455 to your computer and use it in GitHub Desktop.
get last 100 lines from logs nodejitsu
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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