Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

nsyslog-parser

Package Overview
Dependencies
Maintainers
1
Versions
35
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nsyslog-parser

Syslog Parser. Accepts RFC 3164 (BSD) and RFC 5424 formats

  • 0.2.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
727
decreased by-34.5%
Maintainers
1
Weekly downloads
 
Created
Source

nsyslog-parser

Syslog Parser. Accepts RFC 3164 (BSD) and RFC 5424 formats

Installation

npm install nsyslog-parser

Use

const parser = require("nsyslog-parser");

var bsdLine = "<34>Oct 11 22:14:15 mymachine su: 'su root' failed for lonvick on /dev/pts/8";
var ietfLine = "<34>1 2003-10-11T22:14:15.003Z mymachine.example.com su - ID47 - BOM'su root' failed for lonvick on /dev/pts/8";

console.log(parser(bsdLine);
console.log(parser(ietfLine);

Result

{
    originalMessage: '<34>Oct 11 22:14:15 mymachine su: \'su root\' failed for lonvick on /dev/pts/8',
	pri: '<34>',
	prival: 34,
	type: 'BSD',
	ts: 2017-10-11T20:14:15.000Z,
	host: 'mymachine',
	appName: 'su',
	message: '\'su root\' failed for lonvick on /dev/pts/8',
	fields: [],
	header: '<34>Oct 11 22:14:15 mymachine su: '
}
{
	originalMessage: '<34>1 2003-10-11T22:14:15.003Z mymachine.example.com su - ID47 - BOM\'su root\' failed for lonvick on /dev/pts/8',
	pri: '<34>',
	prival: 34,
	version: 1,
	type: 'RFC5424',
	ts: 2003-10-11T22:14:15.003Z,
	host: 'mymachine.example.com',
	appName: 'su',
	pid: '-',
	messageid: 'ID47',
	structuredData: '-',
	message: 'BOM\'su root\' failed for lonvick on /dev/pts/8',
	fields: [],
	header: '<34>1 2003-10-11T22:14:15.003Z mymachine.example.com su - ID47 - ' 
}

Keywords

FAQs

Package last updated on 03 May 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

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc