Skip to content

Latest commit

 

History

History
82 lines (62 loc) · 1.68 KB

File metadata and controls

82 lines (62 loc) · 1.68 KB

Log parser Build Status

Convert any log file into JSON and serve it as an API.

Forked from es6-babel-express-mocha-starter.

Quick start

# pre-setup
npm install -g nodemon babel-cli mocha # may need "sudo"

# setup
git clone https://github.com/500tech/nodejs-express-es6.git   
cd nodejs-express-es6  
npm install  

# start the server (starts babel-node with nodemon)
npm start 

# open in browser
http://localhost:3000

# build for production (output to dist folder)
npm run build

Brought to you with love, from us at 500Tech - Israel's leading AngularJS consultancy

Forked by @underscoredam

Routes

List available configurations

  • URL /
  • Methods GET
  • Responses
    • Code: 200
    • Response:
    {
        "code": 0,
        "availableConfigs": ['nginx_access_log', ...]
    }

Show log file for configuration

  • URL /<config>
  • Methods GET
  • Responses
    • Code: 200
    • Response:
    {
        "code": 0,
        "logs": [row1, row2, ...]
    }

Available logging configs

nginx_access_log

Default nginx access log located at /var/www/nginx/access.log.

  • Example:
{
    "remote_addr": "127.0.0.1",
    "remote_user": "-",
    "date": "26/Feb/2017:08:03:43 -0600",
    "request": "HEAD / HTTP/1.1",
    "status": 200,
    "body_bytes_sent": 0,
    "http_referrer": "-",
}

License

The MIT License