You're Invited:Meet the Socket Team at RSAC and BSidesSF 2026, March 23–26.RSVP
Socket
Book a DemoSign in
Socket

nginxparser

Package Overview
Dependencies
Maintainers
2
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nginxparser

Parse Nginx log files

latest
Source
npmnpm
Version
2.1.0
Version published
Weekly downloads
180
-57.45%
Maintainers
2
Weekly downloads
 
Created
Source

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) {
    //...
});

FAQs

Package last updated on 29 Jun 2017

Did you know?

Socket

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