1.1.4 • Published 10 years ago

log2mongo v1.1.4

Weekly downloads
1
License
MIT
Repository
github
Last release
10 years ago

build status

注意:Travis-ci 的执行 path 好奇怪,大家用拉下来执行 `npm test`

log2mongo

import JSON to mongodb, associate with sofish/log2json to manage nginx logs.

$ npm install log2mongo -g

Usage

It's a command line tool and should install with the -g flag.

$ log2mongo config.js

The config.js should be a node module like this:

module.exports = {
  "db": "db-name",
  "host": "127.0.0.1:27017",
  "collection": "collection",       // {function|string} collection to insert, or a function returns a string

  "dir": "dir/contains/logs",       // where to find logs
  "skip": skip(filename)            // {function} [optional] a function return Boolean, when True, file ignored
  "separator": "•-•",               // separator of your (nginx/apache/whatever) log fields
  "map": [],                        // map with log fields that create by `split(separator)`

  "username": "sofish",             // [optional] db username
  "password": "***"                 // [optional] db password
}

Test

Simply run npm test to see what happens.

1.1.4

10 years ago

1.1.3

10 years ago

1.1.2

10 years ago

1.1.1

10 years ago

1.1.0

10 years ago

1.0.9

10 years ago

1.0.8

10 years ago

1.0.7

10 years ago

1.0.6

10 years ago

1.0.5

10 years ago

1.0.4

10 years ago

1.0.3

10 years ago

1.0.2

10 years ago

1.0.1

10 years ago

1.0.0

10 years ago