# nginxparser

> Parse Nginx log files

Latest version **2.1.0** (published 2017-06-29) · 0 weekly downloads

## Install

```sh
npm install nginxparser
pnpm add nginxparser
yarn add nginxparser
bun add nginxparser
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.1.0 |
| Published | 2017-06-29 |
| First published | 2012-06-17 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=0.7.11 |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 64 |
| Author | Chris O'Hara |
| Maintainers | cohara87, jbergstroem |

## Links

- npm: https://www.npmjs.com/package/nginxparser
- Repository: https://github.com/chriso/nginx-parser
- Homepage: http://github.com/chriso/nginx-parser
- Issues: http://github.com/chriso/nginx-parser/issues
- npm.io page: https://npm.io/package/nginxparser

## Recent versions

- 2.1.0 (latest) — 2017-06-29
- 2.0.0 — 2017-04-11
- 1.2.5 — 2016-03-07
- 1.2.4 — 2016-01-27
- 1.2.3 — 2015-08-31
- 1.2.2 — 2015-08-30
- 1.2.1 — 2015-08-12
- 1.2.0 — 2014-12-06
- 1.1.0 — 2014-04-19
- 1.0.2 — 2013-11-29
- 1.0.1 — 2013-11-29
- 0.1.0 — 2012-06-17

## README

**nginx-parser** parse nginx log files in node.js

### Installation

```bash
$ npm install nginxparser
```

### Usage

To read a log file

```javascript
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`)

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

---
_Source: https://npm.io/package/nginxparser · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
