2.1.0 • Published 7 years ago

nginxparser v2.1.0

Weekly downloads
567
License
-
Repository
github
Last release
7 years ago

nginx-parser parse nginx log files in node.js

Installation

$ npm install nginxparser

Usage

To read a log file

var NginxParser = require('nginxparser');

var parser = new NginxParser('$remote_addr - $remote_user [$time_local] '
		+ '"$request" $status $body_bytes_sent "$http_referer" "$http_user_agent"');

parser.read(path, function (row) {
    console.log(row);
}, function (err) {
    if (err) throw err;
    console.log('Done!')
});

To read from stdin, pass - as the path.

To tail a log file (equivalent to tail -F)

parser.read(path, { tail: true }, function (row) {
    //...
});
2.1.0

7 years ago

2.0.0

7 years ago

1.2.5

8 years ago

1.2.4

8 years ago

1.2.3

9 years ago

1.2.2

9 years ago

1.2.1

9 years ago

1.2.0

9 years ago

1.1.0

10 years ago

1.0.2

10 years ago

1.0.1

10 years ago

0.1.0

12 years ago