GithubHelp home page GithubHelp logo

couchdb-log-parse's Introduction

couchdb-log-parse

A program for parsing CouchDB logs

Usage

var LogParse = require('couchdb-log-parse')
var parser = new LogParse()

fs.createReadStream('couchdb.log').pipe(parser)

parser.on('data', function (c) {
  // this is the raw data, don't know why you need this, but whatever
})

parser.on('message', function (message) {
  // this is probably what you want.
  // it's the parsed object with informative fields
})

Fields

The parsed messages all have these fields:

  • date The date that the log was posted
  • level Usually one of info, warn, or error
  • pid Not a real pid. Some kind of silly erlang goober.
  • type Either 'http', 'erl', or 'misc'

Depending on the type they may have the following fields as well:

http

  • ip The requesting IP. (If you're behind a proxy or load balancer, then it's not super interesting.)
  • method Something like GET, POST, PUT, etc.
  • url The url requested
  • statusCode The response status code.

erl

  • message Whatever comes before the dump. Sometimes blank.
  • dump The dumped erlang object. (If someone wants to write a parser for the erlang objdump notation, that'd be rad.)

misc

  • message Whatever it was that couldn't be parsed.

couchdb-log-parse's People

Contributors

isaacs avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.