Giter Club home page Giter Club logo

apache-clf-parser's Introduction

Apache CLF Parser

This module parses Apache common log format files, counts number of times a resource has been accessed and produces a csv file with the stats.

Usage

  1. install the module
$ npm install https://github.com/minustime/apache-clf-parser
  1. Setup your script
// index.js

const parser = require('apache-clf-parser');

parser.parse({
  logs: 'logs',
  logExtension: 'log'
});
  1. Run it
$ node index.js

Options

An optional object can be passed to the parse function with the following properties.

option type default description
logs string logs directory where logs files are located, can include gzipped files
logExtension string gz log file extension
report string report.csv name of csv file to write report to
logSource string string that gets prepended to each resource line in report file
filterByVerb array [GET, POST] array of HTTP verbs to filter by
ignoreResource array array of resource paths to ignore

Report

Sample csv report:

Resource,Access Count
"https:/www.kennedyspacecenter.com/images/KSC-logosmall.gif",20
"https:/www.kennedyspacecenter.com/images/NASA-logosmall.gif",16
"https:/www.kennedyspacecenter.com/images/MOSAIC-logosmall.gif",15
"https:/www.kennedyspacecenter.com/images/ksclogo-medium.gif",14
"https:/www.kennedyspacecenter.com/images/USA-logosmall.gif",14
"https:/www.kennedyspacecenter.com/images/WORLD-logosmall.gif",14
"https:/www.kennedyspacecenter.com/",11
"https:/www.kennedyspacecenter.com/history/apollo/images/apollo-logo1.gif",10

apache-clf-parser's People

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

deeznulls

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.