Created
April 10, 2015 13:25
-
-
Save vieiralucas/03173bb869867dbe2d02 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| #!/usr/bin/env node | |
| var readline = require('readline'), | |
| unflatten = require('flat').unflatten, | |
| logfmt = require('logfmt'); | |
| var rl = readline.createInterface({ | |
| input: process.stdin, | |
| output: process.stdout | |
| }); | |
| rl.on('line', function(line) { | |
| line = 'request.ip' + line.split('- request.ip')[1]; | |
| process.stdout.write(JSON.stringify(unflatten(logfmt.parse(line)))); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment