Git Product home page Git Product logo

vhoststats's Introduction

Virtual Host Statistics

Overview

vhoststats reads an Apache log file with virtual host information (the %v token in your CustomLog directive) and displays a dynamic bar graph showing the activity of the busiest hosts (sorted by number of requests or bytes transferred).

The output might look something like this:

[2010/02/19 20:21:32] Hosts: 7 [Displayed: 7] Requests: 104

host1.companyA.com   [R:1         ]  #
                     [B:3         ]
devel.internal       [R:1         ]  #
                     [B:208       ]
host2.companyA.com   [R:1         ]  #
                     [B:4499      ]
A-truncated-host-nam [R:10        ]  ############
                     [B:65380     ]  #
host1.companyB.com   [R:21        ]  ##########################
                     [B:166715    ]  ####
www.google.com       [R:32        ]  #################################
                     [B:1566614   ]  ####################################

Installation

vhoststats uses a standard python setup.py script, so:

python setup.py install

Usage

Usage: vhoststats [options]

Options:
  -h, --help            show this help message and exit
  -v VHOST_FIELD, --vhost-field=VHOST_FIELD
  -t TIME_FIELD, --time-field=TIME_FIELD
  -s SIZE_FIELD, --size-field=SIZE_FIELD
  -w WINDOW_SIZE, --window-size=WINDOW_SIZE
  -B, --bytes
  -R, --requests

vhoststats can read Apache log files in a variety of formats. The default configuration assumes you're using the standard combined format with the addition of the virtual host name at the beginning of each log entry. If your log is formatted differently, you can specify three options to help vhoststats find the information it needs:

  • -v, --vhost-field -- The field index of the virtual host name.
  • -t, --time-field -- The field index of the datestamp.
  • -s, --size-field -- The field index of the byte count.

In the default log format:

hostA.company.com0 10.10.100.100 - - [19/Feb/2010:15:24:56 -0500]
  "GET /publications/liu2002b.pdf HTTP/1.1" 404 223 "-"
  "msnbot/2.0b (+http://search.msn.com/msnbot.htm)" mod_deflate:-

The virtual host name is index 0, the datestamp is index 4, and the bytes field is index 7. Hopefully that makes it clear how we count fields.

By default, vhoststats keeps a five-minute running total of number of requests and bytes transferred for reach virtual host. You can change the window size with the --window-size (-w) option.

You can sort hosts by bytes (--bytes, -B), the default, or by number of requests (--requests, -R).

License

vhoststats Copyright (C) 2010 Lars Kellogg-Stedman

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.

For more information

vhoststats's People

Contributors

larsks avatar

Stargazers

Vasyl Dizhak avatar  avatar

Watchers

 avatar James Cloos 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.