syslog-parse
TypeScript icon, indicating that this package has built-in type declarations

2.0.0 • Public • Published

syslog-parse Build Status

Parse syslog-formatted messages.

Installation

$ npm install --save syslog-parse

Usage

import parse from 'syslog-parse';

const log = parse(
	'<38>Feb 05 01:02:03 abc system[253]: Listening at 0.0.0.0:3000',
);

/*
log = {
  priority: 38,
  facilityCode: 4,
  facility: 'auth',
  severityCode: 6,
  severity: 'info',
  time: Thu Feb 05 2015 01:02:03 GMT+0100 (CET),
  host: 'abc',
  process: 'system',
  pid: 253,
  message: 'Listening at 0.0.0.0:3000'
}
*/

API

parse(input)

If input can't be parsed, it returns undefined. Otherwise it returns an object.

input

Type: string

Log string.

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
2.0.05latest

Version History

VersionDownloads (Last 7 Days)Published
2.0.05
1.3.1584
1.3.00
1.1.00
1.0.30
1.0.20
1.0.10
1.0.00

Package Sidebar

Install

npm i syslog-parse

Weekly Downloads

589

Version

2.0.0

License

MIT

Unpacked Size

5.8 kB

Total Files

5

Last publish

Collaborators

  • vdemedes