« »
AnyData - A case study.
You can also use AnyData to do advanced searching in your data.

Now, suppose you have those same web access logs:

 annoy.com - - [12/Apr/2004:14:33:56 -0400] "GET /perl-qa/2003-03 HTTP/1.0" 301 241 "-" "Mozilla/5.0"
 annoy.com - - [12/Apr/2004:14:36:25 -0400] "GET /perl-qa/2003-03/ HTTP/1.0" 200 7394 "-" "Mozilla/5.0"
 1.2.3.4 - - [12/Apr/2004:14:42:08 -0400] "GET /robots.txt HTTP/1.1" 404 216 "-" "Some browser"
 1.2.3.4 - - [12/Apr/2004:14:42:11 -0400] "GET /cgi-bin/namazu.cgi?idxname=perl6-internals HTTP/1.1" 200 9709 "-" "Some browser"

This time, you want to find out how many times you got hit from annoy.com and did not return a page.

  #!/usr/local/bin/perl
    
  use strict;
  use AnyData;
    
  my $table = adTie( 'Weblog', 'access_log', 'u' );
  my $hits = $table->{{remotehost => 'annoy.com',
                       status => '!= 200' }};
  
  print "I failed on ", scalar @$hits, " hits.";

Copyright (c) 2004 pair Networks, Inc. | Daniel J. Wright