Giter Site home page Giter Site logo

jylitalo / node-elb-log-parser Goto Github PK

View Code? Open in Web Editor NEW

This project forked from toshihirock/node-elb-log-parser

0.0 2.0 0.0 9 KB

A basic parser for ELB access logs, strongly inspired by node-clf-parser https://github.com/jfhbrook/node-clf-parser

JavaScript 100.00%

node-elb-log-parser's Introduction

elb-log-parser

npm version Build Status

A basic parser for ELB access logs, strongly inspired by node-clf-parser https://github.com/jfhbrook/node-clf-parser.

When I use this npm?

Install

npm install -g elb-log-parser

Example command-line usage

906058675309_elasticloadbalancing_us-east-1_my-elb_20160420T1700Z_10.0.33.113_115hdtdv.log > elb-log-parser

Outputs JSON which can then be further processed with e.g. something like the json tool.

Example API usage

node-elb-log-parser$node
> var parse = require('./index');
undefined
> parse('2015-05-13T23:39:43.945958Z my-loadbalancer 192.168.131.39:2817 10.0.0.1:80 0.000086 0.001048 0.001337 200 200 0 57 "GET https://mytest-111.ap-northeast-1.elb.amazonaws.com:443/p/a/t/h?foo=bar&hoge=fuga HTTP/1.1" "curl/7.38.0" DHE-RSA-AES128-SHA TLSv1.2')
{ timestamp: '2015-05-13T23:39:43.945958Z',
  elb: 'my-loadbalancer',
  client: '192.168.131.39',
  client_port: '2817',
  backend: '10.0.0.1',
  request_processing_time: '0.000086',
  backend_processing_time: '0.001048',
  response_processing_time: '0.001337',
  elb_status_code: '200',
  backend_status_code: '200',
  received_bytes: '0',
  sent_bytes: '57',
  request: 'GET https://mytest-111.ap-northeast-1.elb.amazonaws.com:443/p/a/t/h?foo=bar&hoge=fuga HTTP/1.1',
  user_agent: 'curl/7.38.0',
  ssl_cipher: 'DHE-RSA-AES128-SHA',
  ssl_protocol: 'TLSv1.2',
  backend_port: '80',
  request_method: 'GET',
  request_uri: 'https://mytest-111.ap-northeast-1.elb.amazonaws.com:443/p/a/t/h?foo=bar&hoge=fuga',
  request_http_version: 'HTTP/1.1',
  request_uri_scheme: 'https:',
  request_uri_host: 'mytest-111.ap-northeast-1.elb.amazonaws.com',
  request_uri_port: '443',
  request_uri_path: '/p/a/t/h',
  request_uri_query: 'foo=bar&hoge=fuga' }
>

You get the idea.

Tests

$npm test

License

WTFPL

node-elb-log-parser's People

Contributors

rpaterson avatar toshihirock 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.