Lincoln Stein wrote some code once that detected "robots" by looking at weblogs: looking for long sessions from identical IP addresses crossed with UserAgent strings. I don't recall where I got the code now, but I know it was interesting in terms of analysis.
It might have been in the mod_perl book, or perhaps his Net::* book.
-- Randal L. Schwartz, Perl hacker