Read more

Parse & sort unique hits in logfiles

Thomas Eisenbarth
October 21, 2011Software engineer at makandra GmbH

If you want to know the exact hits on your website (or whatever logfile you want) for a specific date without duplicates, here's how.
"Unique" means you don't want to count hits to an URL originating from the same IP twice.

Illustration UI/UX Design

UI/UX Design by makandra brand

We make sure that your target audience has the best possible experience with your digital product. You get:

  • Design tailored to your audience
  • Proven processes customized to your needs
  • An expert team of experienced designers
Read more Show archive.org snapshot

You can use the attached script to do so:

# ./log_parser.rb 2011-10-04

27 hits on /rss.xml
36 hits on /stylesheets/fonts/slkscr-webfont.woff
37 hits on /stylesheets/fonts/slkscrb-webfont.woff
37 hits on /images/bullet.png
38 hits on /images/download.png
38 hits on /images/play.png
39 hits on /stylesheets/gameboy.css
39 hits on /stylesheets/screen.css
39 hits on /javascripts/jquery-1.6.1.min.js
43 hits on /images/hosts/x2/arne.png
43 hits on /images/hosts/x2/thomas.png
43 hits on /images/hosts/x2/henning.png
45 hits on /
46 hits on /images/die-nerdtanke-75x75.png
50 hits on /favicon.ico
260 hits on /podcasts/nerdtanke-8.mp3
Posted by Thomas Eisenbarth to makandra dev (2011-10-21 14:58)