Skip to content

ServerChef/log-parser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Parse logs into JSON API

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published