One of my clients' website traffic is composed of over 75% bot traffic. Server-side logs are unusable for anything other than site performance.
One of my clients' website traffic is composed of over 75% bot traffic. Server-side logs are unusable for anything other than site performance.
I'm unclear how broad you intend that second sentence to be, but there's still a ton of info you can glean just from server-side logs:
- Referrer info, and, by extension, popular search terms being used to find your site;
- Paths on your site causing 5xx errors (so pages which might be triggering an error in a server-side script)
- Paths on your site causing 4xx errors, and associated referrers (might be broken links on your own site; might be stale search engine indexing)
- Mobile vs desktop access statistics
Finding this data among a bunch of bot-induced noise might be annoying, but if they're good bots and sending proper UA headers specifying their botness, it's easy enough to filter out. Even otherwise there might be typical bot-like behavior you can find and account for such as not sending a referrer header or trying to access known exploitable PHP scripts (in which case you should block that IP address for a few hours or days - there are programs which can do this sort of thing automatically but frustratingly I can't recall the name of one off the top of my head right now).
Granted, a lot of this can be spoofed, but I'm pretty sure the number of people sending spoofed referral or UA headers is dwarfed by the number of those (like me) who block Google Analytics and similar cruft entirely.
Frankly I would love to see some serious low-config solutions to analyzing server-side logs. Oh, especially Fastly. Client in question uses Fastly and it blew my mind to find out that there was nothing in place to answer simple questions such as "what are the slowest paths to respond", "which paths are a cache hit most often", "which paths are most hit overall", etc. And being able to look at various dimensions such as browser, bot traffic, country of origin, etc. If you have suggestions…
fail2ban
I have two questions about this:
- Since you know they are bots, why couldn't you filter them?
- On the other hand, couldn't there be bots that run JavaScript which would be tracked client-side?
A decent amount can be filtered by UA. This is inconvenient because UA is a very large piece to log and index on, so you need to do UA processing to do anything useful with it and … well by that point it just becomes a chore and I suspect there's good logging services that do this better than you'd spend your time doing yourself.
> On the other hand, couldn't there be bots that run JavaScript which would be tracked client-side?
They exist but they're more rare by nature, because running JS at bot scale is expensive.
Which is why the OP suggested using tools like goaccess.
There is also an option to ignore IPs/Referrers too which can work very well for such cases.
(1) https://goaccess.io/features#:~:text=Spot%20aggressive%20hos...
Using Lighthouse might be an interesting experiment though.