Technical Services Archive

How to Build a List of Bad Bots Using GoAccess

Bad bots can often overload servers and cause issues with websites, leading to decreased performance and potential disruptions. While various bot lists are available online, it is important to note that many of these lists are outdated and include bots that are not actively causing any problems.

To effectively identify and handle bad bots, relying on web server logs is a preferred approach. By analyzing the server logs, you can generate a sub-log that specifically captures bot hits. If you are using cPanel, the following command can be executed:

[code]

grep -hi bot /usr/local/apache/domlogs/*-ssl_log > bot.log

[/code]

This command will create a new log file, ‘bot.log,’ which will contain all the hits that include the keyword ‘bot.’ The ‘-h’ flag is used to exclude the filename from the output.

In cases where you have multiple sites or larger logs, it might be beneficial to filter your logs and exclude the major well-known good bots. This can be achieved by utilizing the following command:

[code]

grep -hi bot /usr/local/apache/domlogs/*-ssl_log | grep -viE "bing|google|apple"

[/code]

By employing this command, you will obtain a log file that excludes hits from major good bots like Bing, Google, and Apple.

Once you have the ‘bot.log’ file, you can process it using GoAccess, a comprehensive log analyzer. To generate a detailed report of the bots hitting your site, follow these steps:

  1. Launch GoAccess.
  2. Press ‘7’ to access the ‘Top Visitors’ section.
  3. Press ‘Enter’ to generate a detailed report specifically for the bots.
go access bot logs
GoAccess results from bot.log analysis.

 

By utilizing this workflow, you can effectively identify and analyze the bot activity on your website, allowing you to take necessary measures to mitigate any negative impact caused by bad bots.  If you are running cPanel, checkout our our How to Block Bad Blocks on cPanel post.

Practical Thinking on AI, Code, and Risk

Managing AI Operations

You're Buying AI. Who's Managing It?

Buying tools is easy; operationalizing them is where the risk lives. Why tool adoption stalls without pragmatic governance.

Read article

Code & Automation Risk

What to Ask Before You Ship AI-Generated Code

Why 35,000 lines of unowned prompt-code become an organizational liability, and how architectural guardrails protect you.

Read article

Legacy Modernization

Legacy Software a Problem? AI Can Help.

Full rewrites fail 4 out of 5 times. How targeted, AI-assisted refactoring modernizes core systems without big-bang rebuild risk.

Read article

Let's talk about what you need.

Tell me about your situation. If there's a fit, we'll schedule a call.

Start a Conversation