logagent-js
Advanced tools
Comparing version 1.0.17 to 1.0.18
@@ -29,2 +29,3 @@ #!/usr/bin/env node | ||
var logseneToken = argv.t || process.env.LOGSENE_TOKEN | ||
var http = require('http') | ||
@@ -57,2 +58,17 @@ function getFilesizeInBytes (filename) { | ||
function textMsgBodyHandler (req,res) { | ||
var body = '' | ||
req.on('data', function (data) { | ||
body += data | ||
}) | ||
req.on('end', function () { | ||
parseLine(body, argv.n || 'cloudfoundry', log) | ||
res.end('ok\n') | ||
}) | ||
} | ||
function getHttpServer (port) { | ||
server = http.createServer(textMsgBodyHandler) | ||
return server.listen(port) | ||
} | ||
function tailFile (file) { | ||
@@ -136,2 +152,5 @@ var tail = new Tail(file, {start: getFilesizeInBytes(file)}) | ||
} | ||
if(argv.cfhttp) { | ||
getHttpServer(argv.cfhttp) | ||
} | ||
if (argv._.length > 0) { | ||
@@ -138,0 +157,0 @@ // tail files |
{ | ||
"name": "logagent-js", | ||
"version": "1.0.17", | ||
"version": "1.0.18", | ||
"description": "Smart log parser written in Node", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
Sorry, the diff of this file is not supported yet
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
47378
407
1