Git Product home page Git Product logo

count's Introduction

count : count fields in text files

This is a unix commandline filter handy for summarising quick greps in logs.

For example: grep stuff /path/to/apache/combined/log | count FIELD-NUMBER

such as wondering who is causing all the 404s?

$ grep ' 404 ' /path/to/apache/combined.log | count 0
Summary for field 0

11.80.43.243   4  50.00%
22.85.35.198   1  12.50%
33.6.17.183    1  12.50%
44.246.146.130 1  12.50%
55.249.67.57   1  12.50%
-------------- - -------
	   8 100.00%

and you can also get a quicker visual histogram:

$ grep ' 404 ' /path/to/apache/combined.log | count --histogram 0
Summary for field 0

11.80.43.243   4  50.00% ##############################
22.85.35.198   1  12.50% #######
33.6.17.183    1  12.50% #######
44.246.146.130 1  12.50% #######
55.249.67.57   1  12.50% #######
-------------- - -------
	   8 100.00% ############################################################

Dave Beckett

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.