Socket
Socket
Sign inDemoInstall

ncsa-combined-log-format

Package Overview
Dependencies
11
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    ncsa-combined-log-format

A transform stream, converting combined common log format to object


Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Install size
4.34 MB
Created
Weekly downloads
 

Readme

Source

node-ncsa-combined-log-format

A transform stream, converting combined common log format to object

Usage

npm install common-log-format
var Clf = require("ncsa-combined-log-format");
var stream = require("stream");
var output = new stream.Writable({objectMode:true});
output._write = function(chunk, enc, cb) {
    console.log(chunk);
    cb();
};
var input = new stream.Readable();
var clf = new Clf();
clf.on("error",function(e){
	console.log(e);
});
input.pipe(new Clf()).pipe(output);
input.push("127.0.0.1 logname user [Wed, 11 Jun 2014 15:51:48 GMT] \"GET /package.json HTTP/1.1\" 200 733 \"http://localhost:8000/\" \"userAgent\"\n");
input.push(null);

Will output:

{ host: '127.0.0.1',
  logName: 'logname',
  user: 'user',
  date: 2014-06-11T15:51:48.000Z,
  request: { method: 'GET', httpVersion: '1.1', uri: '/package.json' },
  statusCode: 200,
  size: 733,
  referer: 'http://localhost:8000/',
  userAgent: 'userAgent' }

FAQs

Last updated on 17 Mar 2017

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc